1 /* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-O2 -ffast-math -mcpu=power5 -mabi=no-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" 4 } } */
9 /* { dg-final { scan-assembler-not "xscpsgndp" } } */
11 /* Like ppc-target-1.c, but do not enable the altivec abi on 32-bit, so the
12 power7 code should generate fcpsgn and not xscpsgndp. */
14 double normal1 (double, double);
15 double power5 (double, double) __attribute__((__target__("cpu=power5")));
16 double power6 (double, double) __attribute__((__target__("cpu=power6")));
17 double power6x (double, double) __attribute__((__target__("cpu=power6x")));
18 double power7 (double, double) __attribute__((__target__("cpu=power7")));
19 double power7n (double, double) __attribute__((__target__("cpu=power7,no-vsx")));
20 double normal2 (double, double);
23 double normal1 (double a, double b)
25 return __builtin_copysign (a, b);
29 double power5 (double a, double b)
31 return __builtin_copysign (a, b);
35 double power6 (double a, double b)
37 return __builtin_copysign (a, b);
41 double power6x (double a, double b)
43 return __builtin_copysign (a, b);
47 double power7 (double a, double b)
49 return __builtin_copysign (a, b);
53 double power7n (double a, double b)
55 return __builtin_copysign (a, b);
59 double normal2 (double a, double b)
61 return __builtin_copysign (a, b);