Debian Codegraph @

gcc/testsuite/gcc.target/s390/vector/reverse-elements-5.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -mzarch -march=z14" } */
3 /* { dg-require-effective-target s390_vxe } */
4 /* { dg-final { scan-assembler-times {\tvpdi\t} 5 } } */
5 /* { dg-final { scan-assembler-not {\tvperm\t} } } */
6
7 typedef short __attribute__ ((vector_size (16))) V8HI;
8 typedef int __attribute__ ((vector_size (16))) V4SI;
9 typedef long long __attribute__ ((vector_size (16))) V2DI;
10 typedef float __attribute__ ((vector_size (16))) V4SF;
11 typedef double __attribute__ ((vector_size (16))) V2DF;
12
13 void
14 v8hi (V8HI *x, V8HI y)
15 {
16 V8HI z;
17 for (int i = 0; i < 8; ++i)
18 z[i] = y[7 - i];
19 *x = z;
20 }
21
22 void
23 v4si (V4SI *x, V4SI y)
24 {
25 V4SI z;
26 for (int i = 0; i < 4; ++i)
27 z[i] = y[3 - i];
28 *x = z;
29 }
30
31 void
32 v2di (V2DI *x, V2DI y)
33 {
34 V2DI z;
35 for (int i = 0; i < 2; ++i)
36 z[i] = y[1 - i];
37 *x = z;
38 }
39
40 void
41 v4sf (V4SF *x, V4SF y)
42 {
43 V4SF z;
44 for (int i = 0; i < 4; ++i)
45 z[i] = y[3 - i];
46 *x = z;
47 }
48
49 void
50 v2df (V2DF *x, V2DF y)
51 {
52 V2DF z;
53 for (int i = 0; i < 2; ++i)
54 z[i] = y[1 - i];
55 *x = z;
56 }