| 1 |
/* Verify that overloaded built-ins for vec_pack with short |
| 2 |
inputs produce the right results. */ |
| 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 char |
| 11 |
testbi_eh (vector bool short vbs2, vector bool short vbs3) |
| 12 |
{ |
| 13 |
return vec_pack (vbs2, vbs3); |
| 14 |
} |
| 15 |
|
| 16 |
vector signed char |
| 17 |
testsi_eh (vector signed short vss2, vector signed short vss3) |
| 18 |
{ |
| 19 |
return vec_pack (vss2, vss3); |
| 20 |
} |
| 21 |
|
| 22 |
vector unsigned char |
| 23 |
testui_eh (vector unsigned short vus2, vector unsigned short vus3) |
| 24 |
{ |
| 25 |
return vec_pack (vus2, vus3); |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler-times "vpkuhum" 3 } } */ |