Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / powerpc / ppc-target-2.c
blob8ef95b7a15b66a81042bcfa23503b751684d0cc4
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-O2 -ffast-math -mcpu=power5 -mabi=altivec" } */
5 /* { dg-final { scan-assembler-times "fabs" 3 } } */
6 /* { dg-final { scan-assembler-times "fnabs" 3 } } */
7 /* { dg-final { scan-assembler-times "fsel" 3 } } */
8 /* { dg-final { scan-assembler-times "fcpsgn" 3 } } */
9 /* { dg-final { scan-assembler-times "xscpsgndp" 1 } } */
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); }