Debian Codegraph @

gcc/testsuite/gcc.target/s390/vector/vgm-ti-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target s390_vx } */
3 /* { dg-require-effective-target int128 } */
4 /* { dg-options "-O2 -march=z13 -mzarch -fdump-tree-optimized" } */
5 /* { dg-final { check-function-bodies "**" "" "" } } */
6
7 /* Test loading constants which cannot be loaded via VECTOR GENERATE BYTE MASK
8 nor via VECTOR REPLICATE IMMEDIATE but via VECTOR GENERATE MASK. */
9
10 /* As time of writing this, there is no support for 128-bit integer literals.
11 Therefore, we have to emulate them as e.g. via two long literals. However,
12 this test is all about V1TI const vectors. Thus, ensure that we end up with
13 a V1TI const vector before expanding. */
14 /* { dg-final { scan-tree-dump "{ 0xe0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e }" "optimized" } } */
15 /* { dg-final { scan-tree-dump "{ 0x7ffe7ffe7ffe7ffe7ffe7ffe7ffe7ffe }" "optimized" } } */
16 /* { dg-final { scan-tree-dump "{ 0x7ffffffe7ffffffe7ffffffe7ffffffe }" "optimized" } } */
17 /* { dg-final { scan-tree-dump "{ 0x7ffffffffffffffe7ffffffffffffffe }" "optimized" } } */
18
19 typedef __int128 v1ti __attribute__ ((vector_size (16)));
20 typedef long v2di __attribute__ ((vector_size (16)));
21
22 /*
23 ** test_v1ti_via_vgmb:
24 ** vgm %v24,4,6,0
25 ** br %r14
26 */
27
28 v1ti
29 test_v1ti_via_vgmb (void)
30 {
31 return (v1ti)(v2di){0x0e0e0e0e0e0e0e0e, 0x0e0e0e0e0e0e0e0e};
32 }
33
34 /*
35 ** test_v1ti_via_vgmh:
36 ** vgm %v24,1,14,1
37 ** br %r14
38 */
39
40 v1ti
41 test_v1ti_via_vgmh (void)
42 {
43 return (v1ti)(v2di){0x7ffe7ffe7ffe7ffe, 0x7ffe7ffe7ffe7ffe};
44 }
45
46 /*
47 ** test_v1ti_via_vgmf:
48 ** vgm %v24,1,30,2
49 ** br %r14
50 */
51
52 v1ti
53 test_v1ti_via_vgmf (void)
54 {
55 return (v1ti)(v2di){0x7ffffffe7ffffffe, 0x7ffffffe7ffffffe};
56 }
57
58 /*
59 ** test_v1ti_via_vgmg:
60 ** vgm %v24,1,62,3
61 ** br %r14
62 */
63
64 v1ti
65 test_v1ti_via_vgmg (void)
66 {
67 return (v1ti)(v2di){0x7ffffffffffffffe, 0x7ffffffffffffffe};
68 }