i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr63148.c
blobc562fdd045839be714131a4c630f7cb4a0d8aa24
2 #include "tree-vect.h"
4 /* Extracted from MultiSource/Benchmarks/TSVC/tsc.inc
5 From LLVM test-suite */
7 #define N 40
9 int dummy(double[N], double[N], double[N], double[N]);
11 double array[256*256] __attribute__((aligned(32)));
13 double x[N] __attribute__((aligned(32)));
14 double temp;
15 int temp_int;
16 struct GlobalData
18 __attribute__((aligned(32))) double a[N];
19 int pad1[3];
20 __attribute__((aligned(32))) double b[N];
21 int pad2[5];
22 __attribute__((aligned(32))) double c[N];
23 int pad3[7];
24 __attribute__((aligned(32))) double d[N];
25 int pad4[11];
26 } global_data;
28 __attribute__((aligned(32))) double * const a = global_data.a;
29 __attribute__((aligned(32))) double * const b = global_data.b;
30 __attribute__((aligned(32))) double * const c = global_data.c;
31 __attribute__((aligned(32))) double * const d = global_data.d;
33 void init(void);
34 void check(double *_a, double *_b);
35 int s221(void)
37 int i;
39 init();
40 for (i = 1; i < N; i++)
42 a[i] += c[i] * d[i];
43 b[i] = b[i - 1] + a[i] + d[i];
45 check(a, b);
46 return 0;
49 int set1d(double arr[N], double value)
51 int i;
53 for (i = 0; i < N; i++) {
54 arr[i] = value;
56 return 0;
59 void init(void)
61 set1d(a, 1);
62 set1d(b, 2);
63 set1d(c, 3);
64 set1d(d, 4);
67 void abort(void);
69 void check(double *_a, double *_b)
71 int i;
73 double suma = 0;
74 double sumb = 0;
75 for (i = 0; i < N; i++){
76 suma += _a[i];
77 sumb += _b[i];
79 if (suma != 508)
80 abort();
81 if (sumb != 13340.00)
82 abort();
85 int main(int argc, char *argv[])
87 check_vect ();
88 s221();
89 return 0;