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 -mcpu=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 } } */
9 
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);
17 
18 /* fabs/fnabs/fsel */
normal1(double a,double b)19 double normal1 (double a, double b)
20 {
21   return __builtin_copysign (a, b);
22 }
23 
24 /* fabs/fnabs/fsel */
power5(double a,double b)25 double power5  (double a, double b)
26 {
27   return __builtin_copysign (a, b);
28 }
29 
30 /* fcpsgn */
power6(double a,double b)31 double power6  (double a, double b)
32 {
33   return __builtin_copysign (a, b);
34 }
35 
36 /* fcpsgn */
power6x(double a,double b)37 double power6x (double a, double b)
38 {
39   return __builtin_copysign (a, b);
40 }
41 
42 /* xscpsgndp */
power7(double a,double b)43 double power7  (double a, double b)
44 {
45   return __builtin_copysign (a, b);
46 }
47 
48 /* fcpsgn */
power7n(double a,double b)49 double power7n (double a, double b)
50 {
51   return __builtin_copysign (a, b);
52 }
53 
54 /* fabs/fnabs/fsel */
normal2(double a,double b)55 double normal2 (double a, double b)
56 {
57   return __builtin_copysign (a, b);
58 }
59