| 1 |
/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with int |
| 2 |
inputs produce the right code. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-mvsx -O2" } */ |
| 6 |
/* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */ |
| 7 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 8 |
|
| 9 |
#include <altivec.h> |
| 10 |
|
| 11 |
vector bool long long |
| 12 |
testbi_l (vector bool int vbi2) |
| 13 |
{ |
| 14 |
return vec_unpackl (vbi2); |
| 15 |
} |
| 16 |
|
| 17 |
vector signed long long |
| 18 |
testsi_l (vector signed int vsi2) |
| 19 |
{ |
| 20 |
return vec_unpackl (vsi2); |
| 21 |
} |
| 22 |
|
| 23 |
vector bool long long |
| 24 |
testbi_h (vector bool int vbi2) |
| 25 |
{ |
| 26 |
return vec_unpackh (vbi2); |
| 27 |
} |
| 28 |
|
| 29 |
vector signed long long |
| 30 |
testsi_h (vector signed int vsi2) |
| 31 |
{ |
| 32 |
return vec_unpackh (vsi2); |
| 33 |
} |
| 34 |
|
| 35 |
/* { dg-final { scan-assembler-times "vupkhsw" 2 } } */ |
| 36 |
/* { dg-final { scan-assembler-times "vupklsw" 2 } } */ |