Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_neon_h_ok } */
3 /* { dg-options "-Ofast" } */
4 /* { dg-add-options arm_neon_h } */
5
6 /* Reset fpu to a value compatible with the next pragmas. */
7 #pragma GCC target ("fpu=vfp")
8 #pragma GCC push_options
9
10 #pragma GCC target ("fpu=neon")
11 #include <arm_neon.h>
12
13 /* Check that pragma target is used. */
14 /*
15 **my:
16 ** ...
17 ** vadd.f32 d[0-9]+, d[0-9]+, d[0-9]+
18 ** ...
19 ** bx lr
20 */
21 float32x2_t
22 my (float32x2_t __a, float32x2_t __b)
23 {
24 return __a + __b;
25 }
26
27 #pragma GCC pop_options
28
29 /* Check that fpu=vfp is restored. */
30 /*
31 **my1:
32 ** ...
33 ** vadd.f32 s[0-9]+, s[0-9]+, s[0-9]+
34 ** vadd.f32 s[0-9]+, s[0-9]+, s[0-9]+
35 ** ...
36 ** bx lr
37 */
38 float32x2_t
39 my1 (float32x2_t __a, float32x2_t __b)
40 {
41 return __a + __b;
42 }
43
44 /* { dg-final { scan-assembler "\.fpu\\s+vfp\n" } } */
45 /* { dg-final { scan-assembler "\.fpu\\s+neon\n" } } */
46 /* { dg-final { check-function-bodies "**" "" } } */