1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_p8vector_ok } */
3 /* { dg-options "-maltivec -mdejagnu-cpu=power8" } */
8 test_eq_long_long (vector
bool long long x
, vector
bool long long y
)
10 return vec_cmpeq (x
, y
);
14 test_vsi_packs_vusi_vusi (vector
unsigned short x
,
15 vector
unsigned short y
)
17 return vec_packs (x
, y
);
21 test_vsi_packs_vssi_vssi (vector
signed short x
,
22 vector
signed short y
)
24 return vec_packs (x
, y
);
27 vector
signed short int
28 test_vsi_packs_vsi_vsi (vector
signed int x
,
31 return vec_packs (x
, y
);
34 vector
unsigned short int
35 test_vsi_packs_vui_vui (vector
unsigned int x
,
36 vector
unsigned int y
)
38 return vec_packs (x
, y
);
42 test_vsi_packs_vsll_vsll (vector
signed long long x
,
43 vector
signed long long y
)
45 return vec_packs (x
, y
);
49 test_vui_packs_vull_vull (vector
unsigned long long x
,
50 vector
unsigned long long y
)
52 return vec_packs (x
, y
);
56 test_vsi_packsu_vssi_vssi (vector
signed short x
,
57 vector
signed short y
)
59 return vec_packsu (x
, y
);
63 test_vsi_packsu_vusi_vusi (vector
unsigned short x
,
64 vector
unsigned short y
)
66 return vec_packsu (x
, y
);
70 test_vsi_packsu_vsll_vsll (vector
signed long long x
,
71 vector
signed long long y
)
73 return vec_packsu (x
, y
);
77 test_vsi_packsu_vull_vull (vector
unsigned long long x
,
78 vector
unsigned long long y
)
80 return vec_packsu (x
, y
);
83 vector
unsigned short int
84 test_vsi_packsu_vsi_vsi (vector
signed int x
,
87 return vec_packsu (x
, y
);
90 vector
unsigned short int
91 test_vsi_packsu_vui_vui (vector
unsigned int x
,
92 vector
unsigned int y
)
94 return vec_packsu (x
, y
);
98 test_unsigned_char_popcnt_signed_char (vector
signed char x
)
100 return vec_popcnt (x
);
104 test_unsigned_char_popcnt_unsigned_char (vector
unsigned char x
)
106 return vec_popcnt (x
);
109 vector
unsigned short
110 test_unsigned_short_popcnt_signed_short (vector
short x
)
112 return vec_popcnt (x
);
115 vector
unsigned short
116 test_unsigned_short_popcnt_unsigned_short (vector
unsigned short x
)
118 return vec_popcnt (x
);
122 test_unsigned_int_popcnt_signed_int (vector
int x
)
124 return vec_popcnt (x
);
128 test_unsigned_int_popcnt_unsigned_int (vector
unsigned x
)
130 return vec_popcnt (x
);
133 vector
unsigned long long
134 test_unsigned_long_lont_popcnt_signed_long (vector
long long x
)
136 return vec_popcnt (x
);
139 vector
unsigned long long
140 test_unsigned_long_long_popcnt_unsigned_long (vector
unsigned long long x
)
142 return vec_popcnt (x
);
146 test_vss_mradds_vss_vss (vector
signed short x
, vector
signed short y
,
147 vector
signed short z
)
149 return vec_mradds (x
, y
, z
);
152 vector
signed long long
153 test_vsll_mule_vsi_vsi (vector
signed int x
, vector
signed int y
)
155 return vec_mule (x
, y
);
158 vector
unsigned long long
159 test_vull_mule_vui_vui (vector
unsigned int x
, vector
unsigned int y
)
161 return vec_mule (x
, y
);
164 vector
signed long long
165 test_vsll_mulo_vsi_vsi (vector
signed int x
, vector
signed int y
)
167 return vec_mulo (x
, y
);
170 vector
unsigned long long
171 test_vull_mulo_vui_vui (vector
unsigned int x
, vector
unsigned int y
)
173 return vec_mulo (x
, y
);
177 test_neg_char (vector
signed char x
)
183 test_neg_short (vector
short x
)
189 test_neg_int (vector
int x
)
195 test_neg_float (vector
float x
)
201 test_neg_double (vector
double x
)
207 /* Expected test results:
209 test_eq_long_long 1 vcmpequd inst
210 test_vsi_packs_vsll_vsll 1 vpksdss
211 test_vui_packs_vull_vull 1 vpkudus
212 test_vui_packs_vssi_vssi 1 vpkshss
213 test_vsi_packsu_vssi_vssi 1 vpkshus
214 test_vsi_packsu_vsll_vsll 1 vpksdus
215 test_vsi_packsu_vull_vull 1 vpkudus
216 test_unsigned_char_popcnt_signed_char 1 vpopcntb
217 test_unsigned_char_popcnt_unsigned_char 1 vpopcntb
218 test_unsigned_short_popcnt_signed_short 1 vpopcnth
219 test_unsigned_short_popcnt_unsigned_short 1 vpopcnth
220 test_unsigned_int_popcnt_signed_int 2 vpopcntw
221 test_unsigned_int_popcnt_unsigned_int 1 vpopcntd
222 test_unsigned_long_long_popcnt_unsigned_long 1 vpopcntd
223 test_vss_mradds_vss_vsss 1 vmhraddshs
224 test_vsll_mulo_vsi_vsi 1 vmulosw
225 test_vull_mulo_vui_vui 1 vmulouw
226 test_vsll_mule_vsi_vsi 1 vmulesw
227 test_vull_mule_vui_vui 1 vmuleuw
228 test_neg_char 1 vspltisw, 1 vsububm
229 test_neg_short 1 vspltisw, 1 vsubuhm
230 test_neg_int 1 vspltisw, 1 vsubuwm
231 test_neg_float 1 xvnegsp
232 test_neg_float 1 xvnegdp
235 /* { dg-final { scan-assembler-times "vcmpequd" 1 } } */
236 /* { dg-final { scan-assembler-times "vpksdss" 1 } } */
237 /* { dg-final { scan-assembler-times "vpkudus" 2 } } */
238 /* { dg-final { scan-assembler-times "vpkuhus" 2 } } */
239 /* { dg-final { scan-assembler-times "vpkshss" 1 } } */
240 /* { dg-final { scan-assembler-times "vpkshus" 1 } } */
241 /* { dg-final { scan-assembler-times "vpksdus" 1 } } */
242 /* { dg-final { scan-assembler-times "vpkuwus" 2 } } */
243 /* { dg-final { scan-assembler-times "vpopcntb" 2 } } */
244 /* { dg-final { scan-assembler-times "vpopcnth" 2 } } */
245 /* { dg-final { scan-assembler-times "vpopcntw" 2 } } */
246 /* { dg-final { scan-assembler-times "vpopcntd" 2 } } */
247 /* { dg-final { scan-assembler-times "vmhraddshs" 1 } } */
248 /* { dg-final { scan-assembler-times "vmulosw" 1 } } */
249 /* { dg-final { scan-assembler-times "vmulouw" 1 } } */
250 /* { dg-final { scan-assembler-times "vmulesw" 1 } } */
251 /* { dg-final { scan-assembler-times "vmuleuw" 1 } } */
252 /* { dg-final { scan-assembler-times "vspltisw" 3 } } */
253 /* { dg-final { scan-assembler-times "vsububm" 1 } } */
254 /* { dg-final { scan-assembler-times "vsubuhm" 1 } } */
255 /* { dg-final { scan-assembler-times "vsubuwm" 1 } } */
256 /* { dg-final { scan-assembler-times "xvnegsp" 1 } } */
257 /* { dg-final { scan-assembler-times "xvnegdp" 1 } } */