2 /* { dg-options "-O3 -ffast-math" } */
4 extern void abort (void);
6 #include "vect-fmax-fmin.x"
8 #include "vect-fmaxv-fminv.x"
10 #define DEFN_SETV(type) \
11 void set_vector_##type (pR##type a, type n) \
14 for (i=0; i<16; i++) \
18 #define DEFN_CHECKV(type) \
19 void check_vector_##type (pR##type a, pR##type vec) \
22 for (i=0; i<16; i++) \
27 #define TEST2(fname, type) \
28 set_vector_##type (c##type, 0.0); \
29 fname##_##type (a##type, b##type); \
30 check_vector_##type (c##type, fname##_##type##_vector);
32 #define TEST3(fname, type) \
33 set_vector_##type (c##type, 0.0); \
34 fname##_##type (a##type, b##type, c##type); \
35 check_vector_##type (c##type, fname##_##type##_vector);
37 #define TEST(fname, N) \
38 TEST##N (fname, F32); \
63 F32 max_F32_vector
[] = { 15.0, 14.0, 13.0, 12.0, 11.0, 10.0, 9.0, 8.0,
64 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0 };
66 F64 max_F64_vector
[] = { 15.0, 14.0, 13.0, 12.0, 11.0, 10.0, 9.0, 8.0,
67 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0 };
69 F32 min_F32_vector
[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0,
70 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0 };
72 F64 min_F64_vector
[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0,
73 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0 };
75 F32 minv_F32_value
= 0.0f
;
76 F32 maxv_F32_value
= 15.0f
;
78 F64 minv_F64_value
= 0.0;
79 F64 maxv_F64_value
= 15.0;
81 /* Setup input vectors. */
84 aF32
[i
] = (float)(15-i
);
86 aF64
[i
] = (double)(15-i
);
93 /* Test across lanes ops. */
94 if (maxv_f32 (max_F32_vector
) != maxv_F32_value
)
96 if (minv_f32 (min_F32_vector
) != minv_F32_value
)
99 if (maxv_f64 (max_F64_vector
) != maxv_F64_value
)
101 if (minv_f64 (min_F64_vector
) != minv_F64_value
)