| 1 |
/* Verify that overloaded built-ins for vec_add with int |
| 2 |
inputs produce the right results. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-maltivec" } */ |
| 6 |
/* { dg-require-effective-target powerpc_altivec } */ |
| 7 |
|
| 8 |
#include <altivec.h> |
| 9 |
|
| 10 |
vector signed int |
| 11 |
test1 (vector bool int x, vector signed int y) |
| 12 |
{ |
| 13 |
return vec_add (x, y); |
| 14 |
} |
| 15 |
|
| 16 |
vector signed int |
| 17 |
test2 (vector signed int x, vector bool int y) |
| 18 |
{ |
| 19 |
return vec_add (x, y); |
| 20 |
} |
| 21 |
|
| 22 |
vector signed int |
| 23 |
test3 (vector signed int x, vector signed int y) |
| 24 |
{ |
| 25 |
return vec_add (x, y); |
| 26 |
} |
| 27 |
|
| 28 |
vector unsigned int |
| 29 |
test4 (vector bool int x, vector unsigned int y) |
| 30 |
{ |
| 31 |
return vec_add (x, y); |
| 32 |
} |
| 33 |
|
| 34 |
vector unsigned int |
| 35 |
test5 (vector unsigned int x, vector bool int y) |
| 36 |
{ |
| 37 |
return vec_add (x, y); |
| 38 |
} |
| 39 |
|
| 40 |
vector unsigned int |
| 41 |
test6 (vector unsigned int x, vector unsigned int y) |
| 42 |
{ |
| 43 |
return vec_add (x, y); |
| 44 |
} |
| 45 |
|
| 46 |
/* { dg-final { scan-assembler-times "vadduwm" 6 } } */ |