| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target power10_ok } */ |
| 3 |
/* { dg-options "-mdejagnu-cpu=power10 -O2" } */ |
| 4 |
|
| 5 |
#include <altivec.h> |
| 6 |
|
| 7 |
/* Test whether XXSPLTIW is generated for V16HI vector constants where the |
| 8 |
first 4 elements are the same as the next 4 elements, etc. */ |
| 9 |
|
| 10 |
vector unsigned char |
| 11 |
v16qi_const_1 (void) |
| 12 |
{ |
| 13 |
return (vector unsigned char) { 1, 1, 1, 1, 1, 1, 1, 1, |
| 14 |
1, 1, 1, 1, 1, 1, 1, 1, }; /* VSLTPISB. */ |
| 15 |
} |
| 16 |
|
| 17 |
vector unsigned char |
| 18 |
v16qi_const_2 (void) |
| 19 |
{ |
| 20 |
return (vector unsigned char) { 1, 2, 3, 4, 1, 2, 3, 4, |
| 21 |
1, 2, 3, 4, 1, 2, 3, 4, }; /* XXSPLTIW. */ |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-assembler-times {\mxxspltiw\M} 1 } } */ |
| 25 |
/* { dg-final { scan-assembler-times {\mvspltisb\M|\mxxspltib\M} 1 } } */ |
| 26 |
/* { dg-final { scan-assembler-not {\mlxvx?\M} } } */ |
| 27 |
/* { dg-final { scan-assembler-not {\mplxv\M} } } */ |