| 1 |
/* Verify that overloaded built-ins for vec_mule,vec_mulo with char |
| 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 signed short |
| 11 |
test_even (vector signed char x, vector signed char y) |
| 12 |
{ |
| 13 |
return vec_mule (x, y); |
| 14 |
} |
| 15 |
|
| 16 |
vector unsigned short |
| 17 |
test_uns_even (vector unsigned char x, vector unsigned char y) |
| 18 |
{ |
| 19 |
return vec_mule (x, y); |
| 20 |
} |
| 21 |
|
| 22 |
vector signed short |
| 23 |
test_odd (vector signed char x, vector signed char y) |
| 24 |
{ |
| 25 |
return vec_mulo (x, y); |
| 26 |
} |
| 27 |
|
| 28 |
vector unsigned short |
| 29 |
test_uns_odd (vector unsigned char x, vector unsigned char y) |
| 30 |
{ |
| 31 |
return vec_mulo (x, y); |
| 32 |
} |
| 33 |
|
| 34 |
/* { dg-final { scan-assembler-times "vmuleub" 1 } } */ |
| 35 |
/* { dg-final { scan-assembler-times "vmulesb" 1 } } */ |
| 36 |
/* { dg-final { scan-assembler-times "vmuloub" 1 } } */ |
| 37 |
/* { dg-final { scan-assembler-times "vmulosb" 1 } } */ |
| 38 |
|