Debian Codegraph @

gcc/testsuite/gcc.target/s390/vector/vrepi-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 GENERATE MASK but via VECTOR REPLICATE IMMEDIATE. */
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 "{ -0x55555555555555555555555555555556 }" "optimized" } } */
15 /* { dg-final { scan-tree-dump "{ -0x41024102410241024102410241024103 }" "optimized" } } */
16 /* { dg-final { scan-tree-dump "{ -0x4102000041020000410200004103 }" "optimized" } } */
17 /* { dg-final { scan-tree-dump "{ -0x41020000000000004103 }" "optimized" } } */
18
19 typedef __int128 v1ti __attribute__ ((vector_size (16)));
20 typedef long long v2di __attribute__ ((vector_size (16)));
21
22 /*
23 ** test_v1ti_via_vrepib:
24 ** vrepi %v24,-86,0
25 ** br %r14
26 */
27
28 v1ti
29 test_v1ti_via_vrepib (void)
30 {
31 return (v1ti)(v2di){0xaaaaaaaaaaaaaaaa, 0xaaaaaaaaaaaaaaaa};
32 }
33
34 /*
35 ** test_v1ti_via_vrepih:
36 ** vrepi %v24,-16643,1
37 ** br %r14
38 */
39
40 v1ti
41 test_v1ti_via_vrepih (void)
42 {
43 return (v1ti)(v2di){0xbefdbefdbefdbefd, 0xbefdbefdbefdbefd};
44 }
45
46 /*
47 ** test_v1ti_via_vrepif:
48 ** vrepi %v24,-16643,2
49 ** br %r14
50 */
51
52 v1ti
53 test_v1ti_via_vrepif (void)
54 {
55 return (v1ti)(v2di){0xffffbefdffffbefd, 0xffffbefdffffbefd};
56 }
57
58 /*
59 ** test_v1ti_via_vrepig:
60 ** vrepi %v24,-16643,3
61 ** br %r14
62 */
63
64 v1ti
65 test_v1ti_via_vrepig (void)
66 {
67 return (v1ti)(v2di){-16643, -16643};
68 }