aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/swaps-p8-26.c
blob: 88f1dc6579f0d36fff1dbdd6e6437245037f873e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O3 " } */
/* { dg-final { scan-assembler-times "lxvd2x" 2 } } */
/* { dg-final { scan-assembler "stxvd2x" } } */
/* { dg-final { scan-assembler-not "xxpermdi" } } */

/* Verify that swap optimization does not interfere with unaligned
   loads and stores.  */

/* Test case to resolve PR79044.  */

#include <altivec.h>

void pr79044 (float *x, float *y, float *z)
{
  vector float a = __builtin_vec_xl (0, x);
  vector float b = __builtin_vec_xl (0, y);
  vector float c = __builtin_vec_mul (a, b);
  __builtin_vec_xst (c, 0, z);
}