| 1 |
/* { dg-do compile { target powerpc*-*-* } } */ |
| 2 |
/* { dg-options "-maltivec" } */ |
| 3 |
/* { dg-require-effective-target powerpc_altivec } */ |
| 4 |
|
| 5 |
/* Basic test for the new VMX intrinsics. */ |
| 6 |
#include <altivec.h> |
| 7 |
|
| 8 |
int f(vector int a, int b) |
| 9 |
{ |
| 10 |
return vec_extract (a, b); |
| 11 |
} |
| 12 |
short f1(vector short a, int b) |
| 13 |
{ |
| 14 |
return vec_extract (a, b); |
| 15 |
} |
| 16 |
vector short f2(vector short a, int b) |
| 17 |
{ |
| 18 |
return vec_insert (b, a, b); |
| 19 |
} |
| 20 |
vector float f3(vector float a, int b) |
| 21 |
{ |
| 22 |
return vec_insert (b, a, b); |
| 23 |
} |
| 24 |
|
| 25 |
float g(void); |
| 26 |
|
| 27 |
vector float f4(float b, int t) |
| 28 |
{ |
| 29 |
return vec_promote (g(), t); |
| 30 |
} |
| 31 |
vector float f5(float b) |
| 32 |
{ |
| 33 |
return vec_splats (g()); |
| 34 |
} |