Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-target-1.c
blob2168830c9eeda35400abea1fb2fc5e349b8e27f3
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 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);
19 /* fabs/fnabs/fsel */
20 double normal1 (double a, double b)
22 return __builtin_copysign (a, b);
25 /* fabs/fnabs/fsel */
26 double power5 (double a, double b)
28 return __builtin_copysign (a, b);
31 /* fcpsgn */
32 double power6 (double a, double b)
34 return __builtin_copysign (a, b);
37 /* fcpsgn */
38 double power6x (double a, double b)
40 return __builtin_copysign (a, b);
43 /* xscpsgndp */
44 double power7 (double a, double b)
46 return __builtin_copysign (a, b);
49 /* fcpsgn */
50 double power7n (double a, double b)
52 return __builtin_copysign (a, b);
55 /* fabs/fnabs/fsel */
56 double normal2 (double a, double b)
58 return __builtin_copysign (a, b);