1 /* { dg-require-effective-target vect_float } */
5 void __attribute__((noipa
))
6 test (double x0
, double x1
, double *restrict res
, double *restrict ptr
, int n
)
8 for (int i
= 0; i
< n
; i
+= 2)
10 x0
= __builtin_fmin (x0
, ptr
[i
+ 0]);
11 x1
= __builtin_fmin (x1
, ptr
[i
+ 1]);
27 for (int i
= 0; i
< N
; i
+= 2)
29 a
[i
] = i
< HALF
? HALF
- i
: 0;
33 test (N
, N
, res
, a
, 2);
34 if (res
[0] != HALF
|| res
[1] != 0)
37 test (N
, N
, res
, a
, 6);
38 if (res
[0] != HALF
- 4 || res
[1] != 0)
41 test (N
, N
, res
, a
, 8);
42 if (res
[0] != HALF
- 6 || res
[1] != 0)
45 test (N
, N
, res
, a
, 10);
46 if (res
[0] != HALF
- 8 || res
[1] != -1)
49 test (N
, N
, res
, a
, HALF
- 2);
50 if (res
[0] != 4 || res
[1] != -HALF
/ 8 + 1)
53 test (N
, N
, res
, a
, HALF
);
54 if (res
[0] != 2 || res
[1] != -HALF
/ 8 + 1)
57 test (N
, N
, res
, a
, HALF
+ 2);
58 if (res
[0] != 0 || res
[1] != -HALF
/ 8)
61 test (N
, N
, res
, a
, HALF
+ 8);
62 if (res
[0] != 0 || res
[1] != -HALF
/ 8)
65 test (N
, N
, res
, a
, HALF
+ 10);
66 if (res
[0] != 0 || res
[1] != -HALF
/ 8 - 1)
69 test (N
, N
, res
, a
, N
);
70 if (res
[0] != 0 || res
[1] != -N
/ 8 + 1)
73 test (-1, N
, res
, a
, N
);
74 if (res
[0] != -1 || res
[1] != -N
/ 8 + 1)
77 test (-1, -N
/ 8, res
, a
, N
);
78 if (res
[0] != -1 || res
[1] != -N
/ 8)
84 /* { dg-final { scan-tree-dump "Detected reduction" "vect" } } */
85 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_max_reduc } } } */