[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-lxvx-stxvx-1.c
blob936a0377b92ce1ee03fe9c35461817b7380737d4
1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O3" } */
4 /* { dg-final { scan-assembler "lxvx" } } */
5 /* { dg-final { scan-assembler "stxvx" } } */
6 /* { dg-final { scan-assembler-not "lxvd2x" } } */
7 /* { dg-final { scan-assembler-not "stxvd2x" } } */
8 /* { dg-final { scan-assembler-not "xxpermdi" } } */
10 /* Verify P9 vector loads and stores are used rather than the
11 load-swap/swap-store workarounds for P8. */
12 #define N 16
14 signed char ca[N] __attribute__((aligned(16)));
15 signed char cb[] __attribute__((aligned(16)))
16 = {8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7};
17 signed char cc[] __attribute__((aligned(16)))
18 = {1, 1, 2, 2, 3, 3, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2};
20 __attribute__((noinline)) void foo ()
22 int i;
23 for (i = 0; i < N; i++) {
24 ca[i] = cb[i] - cc[i];