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. */
11 #define TEST_COPY(NAME, TYPE) \
12 void NAME ## _copy_native (vector TYPE *a, vector TYPE *b) \
17 void NAME ## _copy_vec (vector TYPE *a, vector TYPE *b) \
19 vector TYPE x = vec_ld (0, b); \
23 #define TEST_COPYL(NAME, TYPE) \
24 void NAME ## _lvxl (vector TYPE *a, vector TYPE *b) \
26 vector TYPE x = vec_ldl (0, b); \
30 #define TEST_VSX_COPY(NAME, TYPE) \
31 void NAME ## _copy_vsx (vector TYPE *a, vector TYPE *b) \
33 vector TYPE x = vec_vsx_ld (0, b); \
34 vec_vsx_st (x, 0, a); \
37 #define TEST_ALIGN(NAME, TYPE) \
38 void NAME ## _align (vector unsigned char *a, TYPE *b) \
40 vector unsigned char x = vec_lvsl (0, b); \
41 vector unsigned char y = vec_lvsr (0, b); \
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)
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)
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)
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 */