| 1 |
/* Test for correct handling of literal arguments. */ |
| 2 |
/* Author: Ziemowit Laski <[email protected]> */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-maltivec" } */ |
| 5 |
/* { dg-require-effective-target powerpc_altivec } */ |
| 6 |
|
| 7 |
#include <altivec.h> |
| 8 |
|
| 9 |
void foo(void) { |
| 10 |
const unsigned char *buf; |
| 11 |
vector pixel vp = { 3, 4, 5, 6 }; |
| 12 |
vector bool int vbi = { 1, 0, 1, 0 }; |
| 13 |
vector bool short vbs = { 1, 0, 1, 0, 1, 0, 1, 0 }; |
| 14 |
vector bool char vbc = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }; |
| 15 |
vector signed char vsc; |
| 16 |
int a = 3; |
| 17 |
|
| 18 |
vec_dst(buf, a, 1); |
| 19 |
vec_dstst(buf, a, 2); |
| 20 |
vec_dststt(buf, a, 3); |
| 21 |
vec_dststt(buf, a, 2); |
| 22 |
|
| 23 |
vp = vec_sld(vp, vp, 5); |
| 24 |
vbc = vec_splat(vbc, 7); |
| 25 |
/* The second argument to vec_splat needs to be less than the number of |
| 26 |
elements in the referenced vector. */ |
| 27 |
vbs = vec_splat(vbs, 4); |
| 28 |
vp = vec_splat(vp, 1); |
| 29 |
vbi = vec_splat(vbi, 3); |
| 30 |
} |