| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -mdejagnu-cpu=power8 -maltivec" } */ |
| 3 |
/* { dg-require-effective-target powerpc_altivec } */ |
| 4 |
|
| 5 |
/* The expansion for vector character multiply introduces a vperm operation. |
| 6 |
This tests that changing the vperm mask allows us to remove all swaps |
| 7 |
from the generated code. */ |
| 8 |
|
| 9 |
#include <altivec.h> |
| 10 |
|
| 11 |
void abort (); |
| 12 |
|
| 13 |
vector unsigned char r; |
| 14 |
vector unsigned char v = |
| 15 |
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; |
| 16 |
vector unsigned char i = |
| 17 |
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; |
| 18 |
|
| 19 |
int main () |
| 20 |
{ |
| 21 |
int j; |
| 22 |
r = v * i; |
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-assembler-times "vperm" 1 } } */ |
| 27 |
/* { dg-final { scan-assembler-not "xxpermdi" } } */ |