Debian Codegraph @

gcc/testsuite/gcc.target/arm/attr-neon.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_neon_ok } */
3 /* { dg-options "-O2 -ftree-vectorize" } */
4 /* { dg-add-options arm_neon arm_v8_vfp } */
5 /* The arm_v8_vfp adds -mfpu=fp-armv8 to the command line, overriding any
6 -mfpu= option set by arm_neon, thus ensuring that the attributes below
7 really are checked for correct fpu selection. */
8
9 /* Verify that neon instructions are emitted once. */
10 void __attribute__ ((target("fpu=neon")))
11 f1(int n, int x[], int y[]) {
12 int i;
13 for (i = 0; i < n; ++i)
14 y[i] = x[i] << 3;
15 }
16
17 void __attribute__ ((target("fpu=vfp")))
18 f3(int n, int x[], int y[]) {
19 int i;
20 for (i = 0; i < n; ++i)
21 y[i] = x[i] << 3;
22 }
23
24 /* { dg-final { scan-assembler-times "\.fpu\\s+vfp\n" 1 } } */
25 /* { dg-final { scan-assembler-times "\.fpu\\s+neon\n" 1 } } */
26 /* { dg-final { scan-assembler-times "vshl" 1 } } */