Debian Codegraph @

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

raw
1 /* { dg-do compile { target lp64 } } */
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 __int128 constants. Thus, ensure that we end up with
13 128-bit constants 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 /*
20 ** test_int128_via_vgmb:
21 ** vgm (%v[0-9]+),4,6,0
22 ** vst \1,0\(%r2\),3
23 ** br %r14
24 */
25
26 __int128
27 test_int128_via_vgmb (void)
28 {
29 return ((__int128) 0x0e0e0e0e0e0e0e0e << 64) | 0x0e0e0e0e0e0e0e0e;
30 }
31
32 /*
33 ** test_int128_via_vgmh:
34 ** vgm (%v[0-9]+),1,14,1
35 ** vst \1,0\(%r2\),3
36 ** br %r14
37 */
38
39 __int128
40 test_int128_via_vgmh (void)
41 {
42 return ((__int128) 0x7ffe7ffe7ffe7ffe << 64) | 0x7ffe7ffe7ffe7ffe;
43 }
44
45 /*
46 ** test_int128_via_vgmf:
47 ** vgm (%v[0-9]+),1,30,2
48 ** vst \1,0\(%r2\),3
49 ** br %r14
50 */
51
52 __int128
53 test_int128_via_vgmf (void)
54 {
55 return ((__int128) 0x7ffffffe7ffffffe << 64) | 0x7ffffffe7ffffffe;
56 }
57
58 /*
59 ** test_int128_via_vgmg:
60 ** vgm (%v[0-9]+),1,62,3
61 ** vst \1,0\(%r2\),3
62 ** br %r14
63 */
64
65 __int128
66 test_int128_via_vgmg (void)
67 {
68 return ((__int128) 0x7ffffffffffffffe << 64) | 0x7ffffffffffffffe;
69 }