[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-target-1.c
blob6f06e920d2ac3bea0f216a3bd763debec637e094
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);
18 /* fabs/fnabs/fsel */
19 double normal1 (double a, double b)
21 return __builtin_copysign (a, b);
24 /* fabs/fnabs/fsel */
25 double power5 (double a, double b)
27 return __builtin_copysign (a, b);
30 /* fcpsgn */
31 double power6 (double a, double b)
33 return __builtin_copysign (a, b);
36 /* fcpsgn */
37 double power6x (double a, double b)
39 return __builtin_copysign (a, b);
42 /* xscpsgndp */
43 double power7 (double a, double b)
45 return __builtin_copysign (a, b);
48 /* fcpsgn */
49 double power7n (double a, double b)
51 return __builtin_copysign (a, b);
54 /* fabs/fnabs/fsel */
55 double normal2 (double a, double b)
57 return __builtin_copysign (a, b);