| 1 |
/* { dg-do run { target { power10_hw } } } */ |
| 2 |
/* { dg-do link { target { ! power10_hw } } } */ |
| 3 |
/* { dg-require-effective-target power10_ok } */ |
| 4 |
/* { dg-options "-mdejagnu-cpu=power10" } */ |
| 5 |
|
| 6 |
#include <altivec.h> |
| 7 |
|
| 8 |
extern void abort (void); |
| 9 |
|
| 10 |
/* Vector string isolate left-justified on array of unsigned char. */ |
| 11 |
vector unsigned char |
| 12 |
silj (vector unsigned char arg) |
| 13 |
{ |
| 14 |
return vec_stril (arg); |
| 15 |
} |
| 16 |
|
| 17 |
int main (int argc, char *argv []) |
| 18 |
{ |
| 19 |
vector unsigned char input1 = |
| 20 |
{ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, |
| 21 |
0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 }; |
| 22 |
vector unsigned char expected1 = |
| 23 |
{ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, |
| 24 |
0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 }; |
| 25 |
vector unsigned char input2 = |
| 26 |
{ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, |
| 27 |
0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }; |
| 28 |
vector unsigned char expected2 = |
| 29 |
{ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, |
| 30 |
0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 00, 0x0 }; |
| 31 |
vector unsigned char input3 = |
| 32 |
{ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, |
| 33 |
0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }; |
| 34 |
vector unsigned char expected3 = |
| 35 |
{ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, |
| 36 |
0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 }; |
| 37 |
vector unsigned char input4 = |
| 38 |
{ 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8, |
| 39 |
0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }; |
| 40 |
vector unsigned char expected4 = |
| 41 |
{ 0x1, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, |
| 42 |
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; |
| 43 |
|
| 44 |
if (!vec_all_eq (silj (input1), expected1)) |
| 45 |
abort (); |
| 46 |
if (!vec_all_eq (silj (input2), expected2)) |
| 47 |
abort (); |
| 48 |
if (!vec_all_eq (silj (input3), expected3)) |
| 49 |
abort (); |
| 50 |
if (!vec_all_eq (silj (input4), expected4)) |
| 51 |
abort (); |
| 52 |
|
| 53 |
} |