| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mdejagnu-cpu=power9 -mvsx -O3 -mfloat128" } */ |
| 3 |
/* { dg-require-effective-target ppc_float128_sw } */ |
| 4 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 5 |
/* { dg-final { scan-assembler "lxvx" } } */ |
| 6 |
/* { dg-final { scan-assembler "stxvx" } } */ |
| 7 |
/* { dg-final { scan-assembler-not "lxvd2x" } } */ |
| 8 |
/* { dg-final { scan-assembler-not "stxvd2x" } } */ |
| 9 |
/* { dg-final { scan-assembler-not "xxpermdi" } } */ |
| 10 |
|
| 11 |
/* Verify P9 vector loads and stores are used rather than the |
| 12 |
load-swap/swap-store workarounds for P8. */ |
| 13 |
#define SIZE (16384/sizeof(__float128)) |
| 14 |
|
| 15 |
static __float128 x[SIZE] __attribute__ ((aligned (16))); |
| 16 |
static __float128 y[SIZE] __attribute__ ((aligned (16))); |
| 17 |
static __float128 a; |
| 18 |
|
| 19 |
void obfuscate(void *a, ...); |
| 20 |
|
| 21 |
void __attribute__((noinline)) do_one(void) |
| 22 |
{ |
| 23 |
unsigned long i; |
| 24 |
|
| 25 |
obfuscate(x, y, &a); |
| 26 |
|
| 27 |
for (i = 0; i < SIZE; i++) |
| 28 |
y[i] = a * x[i]; |
| 29 |
|
| 30 |
obfuscate(x, y, &a); |
| 31 |
} |