1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-O3 -mdejagnu-cpu=power7 -Wno-deprecated" } */
4 /* { dg-require-effective-target powerpc_vsx } */
6 /* Test the various load/store varients. */
10 #define TEST_COPY(NAME, TYPE) \
11 void NAME ## _copy_native (vector TYPE *a, vector TYPE *b) \
16 void NAME ## _copy_vec (vector TYPE *a, vector TYPE *b) \
18 vector TYPE x = vec_ld (0, b); \
22 #define TEST_COPYL(NAME, TYPE) \
23 void NAME ## _lvxl (vector TYPE *a, vector TYPE *b) \
25 vector TYPE x = vec_ldl (0, b); \
29 #define TEST_VSX_COPY(NAME, TYPE) \
30 void NAME ## _copy_vsx (vector TYPE *a, vector TYPE *b) \
32 vector TYPE x = vec_vsx_ld (0, b); \
33 vec_vsx_st (x, 0, a); \
36 #define TEST_ALIGN(NAME, TYPE) \
37 void NAME ## _align (vector unsigned char *a, TYPE *b) \
39 vector unsigned char x = vec_lvsl (0, b); \
40 vector unsigned char y = vec_lvsr (0, b); \
46 TEST_COPY(uchar
, unsigned char)
47 TEST_COPY(schar
, signed char)
48 TEST_COPY(bchar
, bool char)
49 TEST_COPY(ushort
, unsigned short)
50 TEST_COPY(sshort
, signed short)
51 TEST_COPY(bshort
, bool short)
52 TEST_COPY(uint
, unsigned int)
53 TEST_COPY(sint
, signed int)
54 TEST_COPY(bint
, bool int)
55 TEST_COPY(float, float)
56 TEST_COPY(double, double)
60 TEST_COPYL(uchar
, unsigned char)
61 TEST_COPYL(schar
, signed char)
62 TEST_COPYL(bchar
, bool char)
63 TEST_COPYL(ushort
, unsigned short)
64 TEST_COPYL(sshort
, signed short)
65 TEST_COPYL(bshort
, bool short)
66 TEST_COPYL(uint
, unsigned int)
67 TEST_COPYL(sint
, signed int)
68 TEST_COPYL(bint
, bool int)
69 TEST_COPYL(float, float)
70 TEST_COPYL(double, double)
74 TEST_ALIGN(uchar
, unsigned char)
75 TEST_ALIGN(schar
, signed char)
76 TEST_ALIGN(ushort
, unsigned short)
77 TEST_ALIGN(sshort
, signed short)
78 TEST_ALIGN(uint
, unsigned int)
79 TEST_ALIGN(sint
, signed int)
80 TEST_ALIGN(float, float)
81 TEST_ALIGN(double, double)
86 TEST_VSX_COPY(uchar
, unsigned char)
87 TEST_VSX_COPY(schar
, signed char)
88 TEST_VSX_COPY(bchar
, bool char)
89 TEST_VSX_COPY(ushort
, unsigned short)
90 TEST_VSX_COPY(sshort
, signed short)
91 TEST_VSX_COPY(bshort
, bool short)
92 TEST_VSX_COPY(uint
, unsigned int)
93 TEST_VSX_COPY(sint
, signed int)
94 TEST_VSX_COPY(bint
, bool int)
95 TEST_VSX_COPY(float, float)
96 TEST_VSX_COPY(double, double)
97 #endif /* NO_VSX_COPY */