Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vsx-builtin-8.c
blobc909a883c18ba4c87cbf3edf94d2e6eba2f3963c
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
5 /* { dg-options "-O3 -mcpu=power7 -Wno-deprecated" } */
7 /* Test the various load/store varients. */
9 #include <altivec.h>
11 #define TEST_COPY(NAME, TYPE) \
12 void NAME ## _copy_native (vector TYPE *a, vector TYPE *b) \
13 { \
14 *a = *b; \
15 } \
17 void NAME ## _copy_vec (vector TYPE *a, vector TYPE *b) \
18 { \
19 vector TYPE x = vec_ld (0, b); \
20 vec_st (x, 0, a); \
21 } \
23 #define TEST_COPYL(NAME, TYPE) \
24 void NAME ## _lvxl (vector TYPE *a, vector TYPE *b) \
25 { \
26 vector TYPE x = vec_ldl (0, b); \
27 vec_stl (x, 0, a); \
28 } \
30 #define TEST_VSX_COPY(NAME, TYPE) \
31 void NAME ## _copy_vsx (vector TYPE *a, vector TYPE *b) \
32 { \
33 vector TYPE x = vec_vsx_ld (0, b); \
34 vec_vsx_st (x, 0, a); \
35 } \
37 #define TEST_ALIGN(NAME, TYPE) \
38 void NAME ## _align (vector unsigned char *a, TYPE *b) \
39 { \
40 vector unsigned char x = vec_lvsl (0, b); \
41 vector unsigned char y = vec_lvsr (0, b); \
42 vec_st (x, 0, a); \
43 vec_st (y, 8, a); \
46 #ifndef NO_COPY
47 TEST_COPY(uchar, unsigned char)
48 TEST_COPY(schar, signed char)
49 TEST_COPY(bchar, bool char)
50 TEST_COPY(ushort, unsigned short)
51 TEST_COPY(sshort, signed short)
52 TEST_COPY(bshort, bool short)
53 TEST_COPY(uint, unsigned int)
54 TEST_COPY(sint, signed int)
55 TEST_COPY(bint, bool int)
56 TEST_COPY(float, float)
57 TEST_COPY(double, double)
58 #endif /* NO_COPY */
60 #ifndef NO_COPYL
61 TEST_COPYL(uchar, unsigned char)
62 TEST_COPYL(schar, signed char)
63 TEST_COPYL(bchar, bool char)
64 TEST_COPYL(ushort, unsigned short)
65 TEST_COPYL(sshort, signed short)
66 TEST_COPYL(bshort, bool short)
67 TEST_COPYL(uint, unsigned int)
68 TEST_COPYL(sint, signed int)
69 TEST_COPYL(bint, bool int)
70 TEST_COPYL(float, float)
71 TEST_COPYL(double, double)
72 #endif /* NO_COPYL */
74 #ifndef NO_ALIGN
75 TEST_ALIGN(uchar, unsigned char)
76 TEST_ALIGN(schar, signed char)
77 TEST_ALIGN(ushort, unsigned short)
78 TEST_ALIGN(sshort, signed short)
79 TEST_ALIGN(uint, unsigned int)
80 TEST_ALIGN(sint, signed int)
81 TEST_ALIGN(float, float)
82 TEST_ALIGN(double, double)
83 #endif /* NO_ALIGN */
86 #ifndef NO_VSX_COPY
87 TEST_VSX_COPY(uchar, unsigned char)
88 TEST_VSX_COPY(schar, signed char)
89 TEST_VSX_COPY(bchar, bool char)
90 TEST_VSX_COPY(ushort, unsigned short)
91 TEST_VSX_COPY(sshort, signed short)
92 TEST_VSX_COPY(bshort, bool short)
93 TEST_VSX_COPY(uint, unsigned int)
94 TEST_VSX_COPY(sint, signed int)
95 TEST_VSX_COPY(bint, bool int)
96 TEST_VSX_COPY(float, float)
97 TEST_VSX_COPY(double, double)
98 #endif /* NO_VSX_COPY */