Commit 86e4d552 by Sebastian Pop Committed by Sebastian Pop

Add more testcases.

2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>

	* testsuite/gcc.dg/graphite/id-17.c: New.
	* testsuite/gcc.dg/graphite/pr41888.c: New.
	* testsuite/gcc.dg/graphite/scop-22.c: New.
	* testsuite/gfortran.dg/graphite/pr40982.f90: New.

From-SVN: r156546
parent 3070ac15
2010-01-20 Sebastian Pop <sebastian.pop@amd.com>
* testsuite/gcc.dg/graphite/id-17.c: New.
* testsuite/gcc.dg/graphite/pr41888.c: New.
* testsuite/gcc.dg/graphite/scop-22.c: New.
* testsuite/gfortran.dg/graphite/pr40982.f90: New.
2010-01-20 Sebastian Pop <sebastian.pop@amd.com>
* graphite-dependences.c: Clarify comments.
(build_pddr): Add an extra parameter direction.
(graphite_legal_transform_dr): Use build_pddr.
......
typedef struct
{
int offset_for_ref_frame[256];
} seq_parameter_set_rbsp_t;
typedef struct
{
unsigned int num_ref_frames_in_pic_order_cnt_cycle;
int offset_for_ref_frame[1];
int auto_crop_right;
} ImageParameters;
ImageParameters *img;
void GenerateSequenceParameterSet(seq_parameter_set_rbsp_t *sps)
{
unsigned i;
for (i=0; i<img->num_ref_frames_in_pic_order_cnt_cycle; i++)
sps->offset_for_ref_frame[i] = img->offset_for_ref_frame[i];
error("foo");
}
/* { dg-do compile } */
/* { dg-options "-g -O2 -ftree-loop-distribution -fgraphite-identity" } */
int
foo (int *x)
{
int a[10], b[10];
int i;
a[9] = 8;
b[9] = 8;
for (i = 0; i < 9; i++)
{
a[i] = *x++;
b[i] = 1;
}
b[i] = b[i] & !(a[i] ^ *x++);
return b[i] ? i + 1 : 0;
}
double u[1782225];
void foo(int N, int *res)
{
int i;
double a, b;
double sum = 0.0;
for (i = 0; i < N; i++)
{
a = u[i];
u[i] = i * i;
b = u[i];
sum += a + b;
}
*res = sum + N;
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
! { dg-options "-O3 -fgraphite-identity -floop-interchange " }
module mqc_m
implicit none
private
public :: mutual_ind_quad_cir_coil
integer, parameter, private :: longreal = selected_real_kind(15,90)
real (kind = longreal), parameter, private :: pi = 3.141592653589793_longreal
real (kind = longreal), parameter, private :: small = 1.0e-10_longreal
contains
subroutine mutual_ind_quad_cir_coil (r_coil, x_coil, y_coil, z_coil, h_coil, n_coil, &
rotate_coil, m, mu, l12)
real (kind = longreal), intent(in) :: r_coil, x_coil, y_coil, z_coil, h_coil, n_coil, &
mu
real (kind = longreal), dimension(:,:), intent(in) :: rotate_coil
integer, intent(in) :: m
real (kind = longreal), intent(out) :: l12
real (kind = longreal), dimension(3,3) :: rotate_quad
real (kind = longreal), dimension(9), save :: x2gauss, y2gauss, w2gauss, z1gauss, &
w1gauss
real (kind = longreal) :: xxvec, xyvec, xzvec, yxvec, yyvec, yzvec, zxvec, zyvec, &
zzvec, magnitude, l12_lower, l12_upper, dx, dy, dz, theta, &
a, b1, b2, numerator, denominator, coefficient, angle
real (kind = longreal), dimension(3) :: c_vector, q_vector, rot_c_vector, &
rot_q_vector, current_vector, &
coil_current_vec, coil_tmp_vector
integer :: i, j, k
logical, save :: first = .true.
do i = 1, 2*m
theta = pi*real(i,longreal)/real(m,longreal)
c_vector(1) = r_coil * cos(theta)
c_vector(2) = r_coil * sin(theta)
coil_tmp_vector(1) = -sin(theta)
coil_tmp_vector(2) = cos(theta)
coil_tmp_vector(3) = 0.0_longreal
coil_current_vec(1) = dot_product(rotate_coil(1,:),coil_tmp_vector(:))
coil_current_vec(2) = dot_product(rotate_coil(2,:),coil_tmp_vector(:))
coil_current_vec(3) = dot_product(rotate_coil(3,:),coil_tmp_vector(:))
do j = 1, 9
c_vector(3) = 0.5 * h_coil * z1gauss(j)
rot_c_vector(1) = dot_product(rotate_coil(1,:),c_vector(:)) + dx
rot_c_vector(2) = dot_product(rotate_coil(2,:),c_vector(:)) + dy
rot_c_vector(3) = dot_product(rotate_coil(3,:),c_vector(:)) + dz
do k = 1, 9
q_vector(1) = 0.5_longreal * a * (x2gauss(k) + 1.0_longreal)
q_vector(2) = 0.5_longreal * b1 * (y2gauss(k) - 1.0_longreal)
q_vector(3) = 0.0_longreal
rot_q_vector(1) = dot_product(rotate_quad(1,:),q_vector(:))
rot_q_vector(2) = dot_product(rotate_quad(2,:),q_vector(:))
rot_q_vector(3) = dot_product(rotate_quad(3,:),q_vector(:))
numerator = w1gauss(j) * w2gauss(k) * &
dot_product(coil_current_vec,current_vector)
denominator = sqrt(dot_product(rot_c_vector-rot_q_vector, &
rot_c_vector-rot_q_vector))
l12_lower = l12_lower + numerator/denominator
end do
end do
end do
l12 = coefficient * (b1 * l12_lower + b2 * l12_upper)
end subroutine mutual_ind_quad_cir_coil
end module mqc_m
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment