| 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 MASK nor |
| 8 |
via VECTOR REPLICATE IMMEDIATE but via VECTOR GENERATE BYTE 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. Likewise, for 128-bit scalar. */ |
| 14 |
/* { dg-final { scan-tree-dump "{ 0xff00ff0000000000ff00ff00000000 }" "optimized" } } */ |
| 15 |
/* { dg-final { scan-tree-dump "= 0xff00ff0000000000ff00ff00000000;" "optimized" } } */ |
| 16 |
|
| 17 |
typedef long long v2di __attribute__ ((vector_size (16))); |
| 18 |
typedef __int128 v1ti __attribute__ ((vector_size (16))); |
| 19 |
|
| 20 |
/* |
| 21 |
** test_v1ti: |
| 22 |
** vgbm %v24,20560 |
| 23 |
** br %r14 |
| 24 |
*/ |
| 25 |
|
| 26 |
v1ti |
| 27 |
test_v1ti (void) |
| 28 |
{ |
| 29 |
return (v1ti)(v2di){0xff00ff00000000, 0xff00ff00000000}; |
| 30 |
} |
| 31 |
|
| 32 |
/* |
| 33 |
** test_int128: |
| 34 |
** vgbm (%v[0-9]+),20560 |
| 35 |
** vst \1,0\(%r2\),3 |
| 36 |
** br %r14 |
| 37 |
*/ |
| 38 |
|
| 39 |
__int128 |
| 40 |
test_int128 (void) |
| 41 |
{ |
| 42 |
return ((__int128) 0xff00ff00000000 << 64) | 0xff00ff00000000; |
| 43 |
} |