1 /* { dg-require-effective-target vect_float } */
7 #define FN __builtin_fmaxf
10 TYPE
__attribute__((noipa
))
11 test (TYPE x
, TYPE
*ptr
, int n
)
13 for (int i
= 0; i
< n
; ++i
)
28 for (int i
= 0; i
< N
; ++i
)
31 if (test (-1, a
, 1) != 0)
33 if (test (-1, a
, 64) != 63)
35 if (test (-1, a
, 65) != 64)
37 if (test (-1, a
, 66) != 65)
39 if (test (-1, a
, 67) != 66)
41 if (test (-1, a
, 128) != 127)
43 if (test (127, a
, 128) != 127)
45 if (test (128, a
, 128) != 128)
48 for (int i
= 0; i
< N
; ++i
)
51 if (test (-60, a
, 4) != 0)
53 if (test (0, a
, 4) != 0)
55 if (test (1, a
, 4) != 1)
58 for (int i
= 0; i
< HALF
; ++i
)
61 a
[HALF
+ i
] = HALF
- i
;
64 if (test (0, a
, HALF
- 16) != HALF
- 17)
66 if (test (0, a
, HALF
- 2) != HALF
- 3)
68 if (test (0, a
, HALF
- 1) != HALF
- 2)
70 if (test (0, a
, HALF
) != HALF
- 1)
72 if (test (0, a
, HALF
+ 1) != HALF
)
74 if (test (0, a
, HALF
+ 2) != HALF
)
76 if (test (0, a
, HALF
+ 3) != HALF
)
78 if (test (0, a
, HALF
+ 16) != HALF
)
84 /* { dg-final { scan-tree-dump "Detected reduction" "vect" } } */
85 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_max_reduc } } } */