[AArch64] SVE tests
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / maxmin_strict_1.c
blobe90afa2f375236da43fb41cdfce645a5c0c29e07
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include <math.h>
6 #define NUM_ELEMS(TYPE) (320 / sizeof (TYPE))
8 #define DEF_MAXMIN(TYPE, FUN) \
9 void __attribute__ ((noinline, noclone)) \
10 test_##FUN##_##TYPE (TYPE *restrict r, TYPE *restrict a, \
11 TYPE *restrict b) \
12 { \
13 for (int i = 0; i < NUM_ELEMS (TYPE); i++) \
14 r[i] = FUN (a[i], b[i]); \
17 #define TEST_ALL(T) \
18 T (float, fmaxf) \
19 T (double, fmax) \
21 T (float, fminf) \
22 T (double, fmin)
24 TEST_ALL (DEF_MAXMIN)
26 /* { dg-final { scan-assembler-times {\tfmaxnm\tz[0-9]+\.s, p[0-7]/m, z[0-9]+\.s, z[0-9]+\.s\n} 1 } } */
27 /* { dg-final { scan-assembler-times {\tfmaxnm\tz[0-9]+\.d, p[0-7]/m, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
29 /* { dg-final { scan-assembler-times {\tfminnm\tz[0-9]+\.s, p[0-7]/m, z[0-9]+\.s, z[0-9]+\.s\n} 1 } } */
30 /* { dg-final { scan-assembler-times {\tfminnm\tz[0-9]+\.d, p[0-7]/m, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */