OSDN Git Service

* gcc.target/sh/mfmovd.c: Extend list of supported targets.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / powerpc / ppc-round.c
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-O2 -mcpu=power7" } */
5 /* { dg-final { scan-assembler-times "stfiwx" 4 } } */
6 /* { dg-final { scan-assembler-times "lfiwax" 2 } } */
7 /* { dg-final { scan-assembler-times "lfiwzx" 2 } } */
8 /* { dg-final { scan-assembler-times "fctiwz" 2 } } */
9 /* { dg-final { scan-assembler-times "xscvsxddp" 2 } } */
10 /* { dg-final { scan-assembler-times "fcfids" 2 } } */
11 /* { dg-final { scan-assembler-not "lwz" } } */
12 /* { dg-final { scan-assembler-not "stw" } } */
13
14 /* Make sure we don't have loads/stores to the GPR unit.  */
15 double
16 round_double_int (double a)
17 {
18   return (double)(int)a;
19 }
20
21 float
22 round_float_int (float a)
23 {
24   return (float)(int)a;
25 }
26
27 double
28 round_double_uint (double a)
29 {
30   return (double)(unsigned int)a;
31 }
32
33 float
34 round_float_uint (float a)
35 {
36   return (float)(unsigned int)a;
37 }