1 /* Verify that overloaded built-ins for vec_merge* with char
2 inputs produce the right code. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-maltivec -O2" } */
12 vector
signed char vsc1c
= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
13 vector
signed char vsc2c
= {9,10,11,12,13,14,15,16,0,1,2,3,4,5,6,7};
14 return vec_mergel (vsc1c
, vsc2c
);
18 testbc_l (vector
bool char vbc2
, vector
bool char vbc3
)
20 return vec_mergel (vbc2
, vbc3
);
24 testsc_l (vector
signed char vsc2
, vector
signed char vsc3
)
26 return vec_mergel (vsc2
, vsc3
);
30 testuc_l (vector
unsigned char vuc2
, vector
unsigned char vuc3
)
32 return vec_mergel (vuc2
, vuc3
);
36 testbc_h (vector
bool char vbc2
, vector
bool char vbc3
)
38 return vec_mergeh (vbc2
, vbc3
);
42 testsc_h (vector
signed char vsc2
, vector
signed char vsc3
)
44 return vec_mergeh (vsc2
, vsc3
);
48 testuc_h (vector
unsigned char vuc2
, vector
unsigned char vuc3
)
50 return vec_mergeh (vuc2
, vuc3
);
53 /* { dg-final { scan-assembler-times "vmrghb" 3 } } */
54 /* { dg-final { scan-assembler-times "vmrglb" 3 } } */