| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O3 -mzarch -march=z13 -save-temps" } */ |
| 3 |
/* { dg-require-effective-target int128 } */ |
| 4 |
/* { dg-final { scan-assembler "\tvsrl\t" } } */ |
| 5 |
/* { dg-final { scan-assembler "\tvsrlb\t" } } */ |
| 6 |
|
| 7 |
#include <assert.h> |
| 8 |
|
| 9 |
typedef __attribute__ ((vector_size (16))) unsigned long long uv2di; |
| 10 |
typedef __attribute__ ((vector_size (16))) unsigned __int128 uv1ti; |
| 11 |
|
| 12 |
__attribute__ ((noipa)) uv1ti |
| 13 |
const_shift (uv1ti x) |
| 14 |
{ |
| 15 |
return x >> 42; |
| 16 |
} |
| 17 |
|
| 18 |
int |
| 19 |
main (void) |
| 20 |
{ |
| 21 |
uv2di x, y; |
| 22 |
|
| 23 |
x = (uv2di){ 0xcafed00ddeadbeef, 0xcafed00ddeadbeef }; |
| 24 |
y = (uv2di){ 0x000000000032bfb4, 0x0377ab6fbbf2bfb4 }; |
| 25 |
x = (uv2di) const_shift ((uv1ti) x); |
| 26 |
assert (x[0] == y[0] && x[1] == y[1]); |
| 27 |
|
| 28 |
return 0; |
| 29 |
} |