1 /* { dg-additional-options "-fdump-tree-optimized -fno-trapping-math -ffinite-math-only" } */
5 #define N (VECTOR_BITS * 11 / 64 + 3)
7 #define add(A, B) ((A) + (B))
8 #define sub(A, B) ((A) - (B))
9 #define mul(A, B) ((A) * (B))
10 #define div(A, B) ((A) / (B))
13 void __attribute__ ((noipa)) \
14 f_##OP (double *restrict a, double *restrict b, double x) \
16 for (int i = 0; i < N; ++i) \
18 double truev = OP (b[i], x); \
19 a[i] = b[i] < 100 ? truev : b[i]; \
26 _Pragma("GCC novector") \
27 for (int i = 0; i < N; ++i) \
29 int bval = (i % 17) * 10; \
30 int truev = OP (bval, 10); \
31 if (a[i] != (bval < 100 ? truev : bval)) \
33 asm volatile ("" ::: "memory"); \
37 #define FOR_EACH_OP(T) \
51 for (int i
= 0; i
< N
; ++i
)
54 asm volatile ("" ::: "memory");
60 /* { dg-final { scan-tree-dump { = \.COND_ADD} "optimized" { target vect_double_cond_arith } } } */
61 /* { dg-final { scan-tree-dump { = \.COND_SUB} "optimized" { target vect_double_cond_arith } } } */
62 /* { dg-final { scan-tree-dump { = \.COND_MUL} "optimized" { target vect_double_cond_arith } } } */
63 /* { dg-final { scan-tree-dump { = \.COND_RDIV} "optimized" { target vect_double_cond_arith } } } */
64 /* { dg-final { scan-tree-dump { = \.COND_MAX} "optimized" { target vect_double_cond_arith } } } */
65 /* { dg-final { scan-tree-dump { = \.COND_MIN} "optimized" { target vect_double_cond_arith } } } */