1 /* { dg-require-effective-target vect_double } */
2 /* { dg-additional-options "-ffast-math" } */
6 extern void abort (void);
8 typedef __SIZE_TYPE__
size_t;
11 compute(size_t n
, double const * __restrict a
, double const * __restrict b
)
15 for (i
= 0; i
< n
; ++i
)
20 void init(double *, double *);
32 for (i
= 0; i
< 1024; ++i
)
34 ary1
[i
] = 1 / (double)(i
+ 1);
35 ary2
[i
] = 1 + 1 / (double) (i
+ 1);
36 __asm__
volatile ("" : : : "memory");
39 // Compute two results using different starting elements
40 if ((int) compute (512, &ary1
[0], &ary2
[0]) != 525
41 || (int) compute(512, &ary1
[1], &ary2
[1]) != 523)
47 /* All targets should allow vectorizing this by some means of
48 dealing with the known misalignment in loop 2. */
50 /* { dg-final { scan-tree-dump-times "loop vectorized" 2 "vect" } } */