Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/ppc-target-1.c

raw
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_altivec } */
4 /* { dg-require-effective-target powerpc_fprs } */
5 /* { dg-options "-O2 -ffast-math -mdejagnu-cpu=power5 -mabi=altivec" } */
6 /* { dg-final { scan-assembler-times "fabs" 3 } } */
7 /* { dg-final { scan-assembler-times "fnabs" 3 } } */
8 /* { dg-final { scan-assembler-times "fsel" 3 } } */
9 /* { dg-final { scan-assembler-times "fcpsgn\|xscpsgndp" 4 } } */
10
11 double normal1 (double, double);
12 double power5 (double, double) __attribute__((__target__("cpu=power5")));
13 double power6 (double, double) __attribute__((__target__("cpu=power6")));
14 double power6x (double, double) __attribute__((__target__("cpu=power6x")));
15 double power7 (double, double) __attribute__((__target__("cpu=power7")));
16 double power7n (double, double) __attribute__((__target__("cpu=power7,no-vsx")));
17 double normal2 (double, double);
18
19 /* fabs/fnabs/fsel */
20 double normal1 (double a, double b)
21 {
22 return __builtin_copysign (a, b);
23 }
24
25 /* fabs/fnabs/fsel */
26 double power5 (double a, double b)
27 {
28 return __builtin_copysign (a, b);
29 }
30
31 /* fcpsgn */
32 double power6 (double a, double b)
33 {
34 return __builtin_copysign (a, b);
35 }
36
37 /* fcpsgn */
38 double power6x (double a, double b)
39 {
40 return __builtin_copysign (a, b);
41 }
42
43 /* xscpsgndp */
44 double power7 (double a, double b)
45 {
46 return __builtin_copysign (a, b);
47 }
48
49 /* fcpsgn */
50 double power7n (double a, double b)
51 {
52 return __builtin_copysign (a, b);
53 }
54
55 /* fabs/fnabs/fsel */
56 double normal2 (double a, double b)
57 {
58 return __builtin_copysign (a, b);
59 }