aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-3.c
blob: b298173b131650fbbd5465e0d74344c9cd987f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* { dg-do compile { target { powerpc64le-*-* } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
/* { dg-options "-mcpu=power9 -O3" } */
/* { dg-final { scan-assembler "lxvx" } } */
/* { dg-final { scan-assembler "stxvx" } } */
/* { dg-final { scan-assembler-not "lxvd2x" } } */
/* { dg-final { scan-assembler-not "stxvd2x" } } */
/* { dg-final { scan-assembler-not "xxpermdi" } } */

/* Verify P9 vector loads and stores are used rather than the
   load-swap/swap-store workarounds for P8.  */
#define SIZE (16384/sizeof(__float128))

static __float128 x[SIZE] __attribute__ ((aligned (16)));
static __float128 y[SIZE] __attribute__ ((aligned (16)));
static __float128 a;

void obfuscate(void *a, ...);

void __attribute__((noinline)) do_one(void)
{
  unsigned long i;

  obfuscate(x, y, &a);

  for (i = 0; i < SIZE; i++)
    y[i] = a * x[i];

  obfuscate(x, y, &a);
}