1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_altivec } */
4 /* { dg-require-effective-target powerpc_fprs } */
5 /* { dg-options "-O2 -ffast-math -mdejagnu-cpu=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);
20 double normal1 (double a
, double b
)
22 return __builtin_copysign (a
, b
);
26 double power5 (double a
, double b
)
28 return __builtin_copysign (a
, b
);
32 double power6 (double a
, double b
)
34 return __builtin_copysign (a
, b
);
38 double power6x (double a
, double b
)
40 return __builtin_copysign (a
, b
);
44 double power7 (double a
, double b
)
46 return __builtin_copysign (a
, b
);
50 double power7n (double a
, double b
)
52 return __builtin_copysign (a
, b
);
56 double normal2 (double a
, double b
)
58 return __builtin_copysign (a
, b
);