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 -mdejagnu-cpu=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\|xscpsgndp" 4 } } */
10 double normal1 (double, double);
11 double power5 (double, double) __attribute__((__target__("cpu=power5")));
12 double power6 (double, double) __attribute__((__target__("cpu=power6")));
13 double power6x (double, double) __attribute__((__target__("cpu=power6x")));
14 double power7 (double, double) __attribute__((__target__("cpu=power7")));
15 double power7n (double, double) __attribute__((__target__("cpu=power7,no-vsx")));
16 double normal2 (double, double);
19 double normal1 (double a
, double b
)
21 return __builtin_copysign (a
, b
);
25 double power5 (double a
, double b
)
27 return __builtin_copysign (a
, b
);
31 double power6 (double a
, double b
)
33 return __builtin_copysign (a
, b
);
37 double power6x (double a
, double b
)
39 return __builtin_copysign (a
, b
);
43 double power7 (double a
, double b
)
45 return __builtin_copysign (a
, b
);
49 double power7n (double a
, double b
)
51 return __builtin_copysign (a
, b
);
55 double normal2 (double a
, double b
)
57 return __builtin_copysign (a
, b
);