match.pd: Fold vec_perm with view_convert
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-target-1.c
bloba9eb95ab441655cc178f4d5e798596190121d2f5
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);
19 /* fabs/fnabs/fsel */
20 double normal1 (double a, double b)
22 return __builtin_copysign (a, b);
25 /* fabs/fnabs/fsel */
26 double power5 (double a, double b)
28 return __builtin_copysign (a, b);
31 /* fcpsgn */
32 double power6 (double a, double b)
34 return __builtin_copysign (a, b);
37 /* fcpsgn */
38 double power6x (double a, double b)
40 return __builtin_copysign (a, b);
43 /* xscpsgndp */
44 double power7 (double a, double b)
46 return __builtin_copysign (a, b);
49 /* fcpsgn */
50 double power7n (double a, double b)
52 return __builtin_copysign (a, b);
55 /* fabs/fnabs/fsel */
56 double normal2 (double a, double b)
58 return __builtin_copysign (a, b);