Debian Codegraph @

gcc/testsuite/gcc.target/s390/vector/vec-shift-5.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mzarch -march=z13 -save-temps" } */
3 /* { dg-require-effective-target int128 } */
4 /* { dg-final { scan-assembler "\tvsrab\t" } } */
5 /* { dg-final { scan-assembler-not "\tvsra\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 >> 16;
16 }
17
18 int
19 main (void)
20 {
21 v2di x, y;
22
23 x = (v2di){ 0xcafed00ddeadbeef, 0xcafed00ddeadbeef };
24 y = (v2di){ 0xffffcafed00ddead, 0xbeefcafed00ddead };
25 x = (v2di) const_shift ((v1ti) x);
26 assert (x[0] == y[0] && x[1] == y[1]);
27
28 x = (v2di){ 0x4afed00ddead3eef, 0xcafed00ddeadbeef };
29 y = (v2di){ 0x00004afed00ddead, 0x3eefcafed00ddead };
30 x = (v2di) const_shift ((v1ti) x);
31 assert (x[0] == y[0] && x[1] == y[1]);
32
33 return 0;
34 }