1 
2 extern int abs (int);
3 extern long labs (long);
4 
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;
10 
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 		       }
17 
18 DEF_ABS (8);
19 DEF_ABS (16);
20 DEF_ABS (32);
21 DEF_ABS (64);
22 
23 /* Test abs () vectorization.  */
absolute_s32_lib(pRINT32 a,pRINT32 b)24 void absolute_s32_lib (pRINT32 a, pRINT32 b)
25 {
26   int i;
27   for (i=0; i<N; i++)
28     a[i] = abs (b[i]);
29 }
30 
absolute_l32_lib(pRLONG a,pRLONG b)31 void absolute_l32_lib (pRLONG a, pRLONG b)
32 {
33   int i;
34   for (i=0; i<N; i++)
35     a[i] = labs (b[i]);
36 }
37