1 /* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
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=no-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" 4 } } */
10 /* { dg-final { scan-assembler-not "xscpsgndp" } } */
12 /* Like ppc-target-1.c, but do not enable the altivec abi on 32-bit, so the
13 power7 code should generate fcpsgn and not xscpsgndp. */
15 double normal1 (double, double);
16 double power5 (double, double) __attribute__((__target__("cpu=power5")));
17 double power6 (double, double) __attribute__((__target__("cpu=power6")));
18 double power6x (double, double) __attribute__((__target__("cpu=power6x")));
19 double power7 (double, double) __attribute__((__target__("cpu=power7")));
20 double power7n (double, double) __attribute__((__target__("cpu=power7,no-vsx")));
21 double normal2 (double, double);
24 double normal1 (double a
, double b
)
26 return __builtin_copysign (a
, b
);
30 double power5 (double a
, double b
)
32 return __builtin_copysign (a
, b
);
36 double power6 (double a
, double b
)
38 return __builtin_copysign (a
, b
);
42 double power6x (double a
, double b
)
44 return __builtin_copysign (a
, b
);
48 double power7 (double a
, double b
)
50 return __builtin_copysign (a
, b
);
54 double power7n (double a
, double b
)
56 return __builtin_copysign (a
, b
);
60 double normal2 (double a
, double b
)
62 return __builtin_copysign (a
, b
);