| 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 int128 const vectors. Thus, ensure that we end up with |
| 13 |
a int128 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 |
/* |
| 20 |
** test_int128_via_vrepib: |
| 21 |
** vrepi (%v[0-9]+),-86,0 |
| 22 |
** vst \1,0\(%r2\),3 |
| 23 |
** br %r14 |
| 24 |
*/ |
| 25 |
|
| 26 |
__int128 |
| 27 |
test_int128_via_vrepib (void) |
| 28 |
{ |
| 29 |
return ((__int128) 0xaaaaaaaaaaaaaaaa << 64) | 0xaaaaaaaaaaaaaaaa; |
| 30 |
} |
| 31 |
|
| 32 |
/* |
| 33 |
** test_int128_via_vrepih: |
| 34 |
** vrepi (%v[0-9]+),-16643,1 |
| 35 |
** vst \1,0\(%r2\),3 |
| 36 |
** br %r14 |
| 37 |
*/ |
| 38 |
|
| 39 |
__int128 |
| 40 |
test_int128_via_vrepih (void) |
| 41 |
{ |
| 42 |
return ((__int128) 0xbefdbefdbefdbefd << 64) | 0xbefdbefdbefdbefd; |
| 43 |
} |
| 44 |
|
| 45 |
/* |
| 46 |
** test_int128_via_vrepif: |
| 47 |
** vrepi (%v[0-9]+),-16643,2 |
| 48 |
** vst \1,0\(%r2\),3 |
| 49 |
** br %r14 |
| 50 |
*/ |
| 51 |
|
| 52 |
__int128 |
| 53 |
test_int128_via_vrepif (void) |
| 54 |
{ |
| 55 |
return ((__int128) 0xffffbefdffffbefd << 64) | 0xffffbefdffffbefd; |
| 56 |
} |
| 57 |
|
| 58 |
/* |
| 59 |
** test_int128_via_vrepig: |
| 60 |
** vrepi (%v[0-9]+),-16643,3 |
| 61 |
** vst \1,0\(%r2\),3 |
| 62 |
** br %r14 |
| 63 |
*/ |
| 64 |
|
| 65 |
__int128 |
| 66 |
test_int128_via_vrepig (void) |
| 67 |
{ |
| 68 |
return ((__int128) 0xffffffffffffbefd << 64) | 0xffffffffffffbefd; |
| 69 |
} |