c++: normalizing ttp constraints [PR115656]
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-round.c
blobd1b008ad3250f072671f2c190ffc39f9bd8af895
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-O2 -mdejagnu-cpu=power7" } */
4 /* { dg-require-effective-target powerpc_vsx } */
5 /* { dg-final { scan-assembler-times {\mstfiwx\M|\mstxsiwx\M} 4 } } */
6 /* { dg-final { scan-assembler-times {\mlfiwax\M|\mlxsiwax\M} 2 } } */
7 /* { dg-final { scan-assembler-times {\mlfiwzx\M|\mlxsiwzx\M} 2 } } */
8 /* { dg-final { scan-assembler-times {\mfctiwz\M|\mxscvdpsxws\M} 2 } } */
9 /* { dg-final { scan-assembler-times {\mfctiwuz\M|\mxscvdpuxws\M} 2 } } */
10 /* { dg-final { scan-assembler-times {\mfcfids\M|\mxscvsxdsp\M} 2 } } */
11 /* { dg-final { scan-assembler-not {\mlwz\M} } } */
12 /* { dg-final { scan-assembler-not {\mstw\M} } } */
14 /* Make sure we don't have loads/stores to the GPR unit. */
15 double
16 round_double_int (double a)
18 return (double)(int)a;
21 float
22 round_float_int (float a)
24 return (float)(int)a;
27 double
28 round_double_uint (double a)
30 return (double)(unsigned int)a;
33 float
34 round_float_uint (float a)
36 return (float)(unsigned int)a;