Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O3" } */
3 /* { dg-require-effective-target powerpc_vsx } */
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" } } */
9
10 /* Verify P9 vector loads and stores are used rather than the
11 load-swap/swap-store workarounds for P8. */
12 #define N 16
13
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};
19
20 __attribute__((noinline)) void foo ()
21 {
22 int i;
23 for (i = 0; i < N; i++) {
24 ca[i] = cb[i] - cc[i];
25 }
26 }