| 1 |
/* { dg-do run { target { s390*-*-* } } } */ |
| 2 |
/* { dg-require-effective-target s390_vx } */ |
| 3 |
/* { dg-options "-O3 -mzarch -march=z13" } */ |
| 4 |
|
| 5 |
/* For FP zero checks we use the ltdbr instruction. Since this is an |
| 6 |
load and test it actually writes the FPR. Whenever an FPR gets |
| 7 |
written the rest of the overlapping VR is clobbered. */ |
| 8 |
typedef double __attribute__((vector_size(16))) v2df; |
| 9 |
|
| 10 |
v2df a = { 1.0, 2.0 }; |
| 11 |
|
| 12 |
extern void abort (void); |
| 13 |
|
| 14 |
void __attribute__((noinline)) |
| 15 |
foo (v2df a) |
| 16 |
{ |
| 17 |
v2df b = { 1.0, 3.0 }; |
| 18 |
|
| 19 |
b -= a; |
| 20 |
|
| 21 |
/* Take away all the VRs not overlapping with FPRs. */ |
| 22 |
asm volatile ("" : : : |
| 23 |
"v16","v17","v18","v19", |
| 24 |
"v20","v21","v22","v23", |
| 25 |
"v24","v25","v26","v27", |
| 26 |
"v28","v29","v30","v31"); |
| 27 |
if (b[0] != 0.0) /* ltdbr */ |
| 28 |
abort (); |
| 29 |
if (b[1] != 1.0) |
| 30 |
abort (); |
| 31 |
} |
| 32 |
|
| 33 |
int |
| 34 |
main () |
| 35 |
{ |
| 36 |
foo (a); |
| 37 |
return 0; |
| 38 |
} |