[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / swaps-p8-2.c
blobc927daffe8f4a6cc9b27778993dad46eba3bd398
1 /* { dg-do compile { target le } } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O3" } */
4 /* { dg-final { scan-assembler "lxvd2x" } } */
5 /* { dg-final { scan-assembler "stxvd2x" } } */
6 /* { dg-final { scan-assembler-not "xxpermdi" } } */
8 void abort ();
10 #define N 256
11 signed char ca[N] __attribute__((aligned(16)));
12 signed char cb[N] __attribute__((aligned(16)));
13 signed char cc[N] __attribute__((aligned(16)));
15 __attribute__((noinline)) void foo ()
17 int i;
18 for (i = 0; i < N; i++) {
19 ca[i] = cb[i] - cc[i];
23 __attribute__((noinline)) void init ()
25 int i;
26 for (i = 0; i < N; ++i) {
27 cb[i] = i - 128;
28 cc[i] = i/2 - 64;
32 int main ()
34 int i;
35 init ();
36 foo ();
37 for (i = 0; i < N; ++i)
38 if (ca[i] != i - i/2 - 64)
39 abort ();
40 return 0;