Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-target-2.c
blob59d4e2db2acf586199b6e8f29cc7e7750f3db05d
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power5" } } */
5 /* { dg-options "-O2 -ffast-math -mcpu=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 } } */
11 /* fabs/fnabs/fsel */
12 double normal1 (double a, double b) { return __builtin_copysign (a, b); }
14 #pragma GCC push_options
15 #pragma GCC target ("cpu=power5")
16 /* fabs/fnabs/fsel */
17 double power5 (double a, double b) { return __builtin_copysign (a, b); }
18 #pragma GCC pop_options
20 #pragma GCC target ("cpu=power6")
21 /* fcpsgn */
22 double power6 (double a, double b) { return __builtin_copysign (a, b); }
23 #pragma GCC reset_options
25 #pragma GCC target ("cpu=power6x")
26 /* fcpsgn */
27 double power6x (double a, double b) { return __builtin_copysign (a, b); }
28 #pragma GCC reset_options
30 #pragma GCC target ("cpu=power7")
31 /* xscpsgndp */
32 double power7 (double a, double b) { return __builtin_copysign (a, b); }
33 #pragma GCC reset_options
35 #pragma GCC target ("cpu=power7,no-vsx")
36 /* fcpsgn */
37 double power7n (double a, double b) { return __builtin_copysign (a, b); }
38 #pragma GCC reset_options
40 /* fabs/fnabs/fsel */
41 double normal2 (double a, double b) { return __builtin_copysign (a, b); }