| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O3 -mzarch -march=z13 -save-temps" } */ |
| 3 |
/* { dg-require-effective-target int128 } */ |
| 4 |
/* { dg-final { scan-assembler "\tvsra\t" } } */ |
| 5 |
/* { dg-final { scan-assembler-not "\tvsrab\t" } } */ |
| 6 |
|
| 7 |
#include <assert.h> |
| 8 |
|
| 9 |
typedef __attribute__ ((vector_size (16))) signed long long v2di; |
| 10 |
typedef __attribute__ ((vector_size (16))) signed __int128 v1ti; |
| 11 |
|
| 12 |
__attribute__ ((noipa)) v1ti |
| 13 |
const_shift (v1ti x) |
| 14 |
{ |
| 15 |
return x >> 1; |
| 16 |
} |
| 17 |
|
| 18 |
int |
| 19 |
main (void) |
| 20 |
{ |
| 21 |
v2di x, y; |
| 22 |
|
| 23 |
x = (v2di){ 0xcafed00ddeadbeef, 0xcafed00ddeadbeef }; |
| 24 |
y = (v2di){ 0xe57f6806ef56df77, 0xe57f6806ef56df77 }; |
| 25 |
x = (v2di) const_shift ((v1ti) x); |
| 26 |
assert (x[0] == y[0] && x[1] == y[1]); |
| 27 |
|
| 28 |
x = (v2di){ 0x4afed00dbeadbeee, 0xcafed00ddeadbeef }; |
| 29 |
y = (v2di){ 0x257f6806df56df77, 0x657f6806ef56df77 }; |
| 30 |
x = (v2di) const_shift ((v1ti) x); |
| 31 |
assert (x[0] == y[0] && x[1] == y[1]); |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |