| 1 |
/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with char |
| 2 |
inputs produce the right code. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-maltivec -O2" } */ |
| 6 |
/* { dg-require-effective-target powerpc_altivec } */ |
| 7 |
|
| 8 |
#include <altivec.h> |
| 9 |
|
| 10 |
vector bool short |
| 11 |
testbc_l (vector bool char vbc2) |
| 12 |
{ |
| 13 |
return vec_unpackl (vbc2); |
| 14 |
} |
| 15 |
|
| 16 |
vector signed short |
| 17 |
testsc_l (vector signed char vsc2) |
| 18 |
{ |
| 19 |
return vec_unpackl (vsc2); |
| 20 |
} |
| 21 |
|
| 22 |
vector bool short |
| 23 |
testbc_h (vector bool char vbc2) |
| 24 |
{ |
| 25 |
return vec_unpackh (vbc2); |
| 26 |
} |
| 27 |
|
| 28 |
vector signed short |
| 29 |
testsc_h (vector signed char vsc2) |
| 30 |
{ |
| 31 |
return vec_unpackh (vsc2); |
| 32 |
} |
| 33 |
|
| 34 |
/* { dg-final { scan-assembler-times "vupkhsb" 2 } } */ |
| 35 |
/* { dg-final { scan-assembler-times "vupklsb" 2 } } */ |
| 36 |
|