Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / vect-abs.x
blob2e67cc296b5515f4803b0e174167946f770ded9a
2 extern int abs (int);
3 extern long labs (long);
5 typedef signed char *__restrict__ pRINT8;
6 typedef short *__restrict__ pRINT16;
7 typedef int *__restrict__ pRINT32;
8 typedef long *__restrict__ pRLONG;
9 typedef long long *__restrict__ pRINT64;
11 #define DEF_ABS(size)  void absolute_s##size (pRINT##size a, pRINT##size b) \
12                        { \
13                          int i;  \
14                          for (i=0; i<N; i++)     \
15                             a[i] = (b[i] > 0 ? b[i] : -b[i]); \
16                        }
18 DEF_ABS (8);
19 DEF_ABS (16);
20 DEF_ABS (32);
21 DEF_ABS (64);
23 /* Test abs () vectorization.  */
24 void absolute_s32_lib (pRINT32 a, pRINT32 b)
26   int i;
27   for (i=0; i<N; i++)
28     a[i] = abs (b[i]);
31 void absolute_l32_lib (pRLONG a, pRLONG b)
33   int i;
34   for (i=0; i<N; i++)
35     a[i] = labs (b[i]);