gcc/ChangeLog:
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr84154-2.c
blob619777ce8dd301824082c9d6ed7ba4cdbffb2cf7
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
5 /* { dg-options "-mcpu=power8 -O2" } */
7 /* PR target/84154. Make sure on ISA 2.07 (power8) that we store the result of
8 a conversion to char/short using an offsettable address does not generate
9 direct moves for storing 32-bit integers, but does do a direct move for
10 8/16-bit integers. */
12 void
13 double_to_uc (double x, unsigned char *p)
15 p[3] = x;
18 void
19 double_to_sc (double x, signed char *p)
21 p[3] = x;
24 void
25 double_to_us (double x, unsigned short *p)
27 p[3] = x;
30 void
31 double_to_ss (double x, short *p)
33 p[3] = x;
36 void
37 double_to_ui (double x, unsigned int *p)
39 p[3] = x;
42 void
43 double_to_si (double x, int *p)
45 p[3] = x;
48 /* { dg-final { scan-assembler-times {\mfctiwuz\M|\mxscvdpuxws\M} 3 } } */
49 /* { dg-final { scan-assembler-times {\mfctiwz\M|\mxscvdpsxws\M} 3 } } */
50 /* { dg-final { scan-assembler-times {\mmfvsrwz\M} 4 } } */
51 /* { dg-final { scan-assembler-times {\mstfiwx\M|\mstxsiwx\M} 2 } } */
52 /* { dg-final { scan-assembler-times {\mstb\M} 2 } } */
53 /* { dg-final { scan-assembler-times {\msth\M} 2 } } */
54 /* { dg-final { scan-assembler-not {\mlbz\M} } } */
55 /* { dg-final { scan-assembler-not {\mlhz\M} } } */
56 /* { dg-final { scan-assembler-not {\mlha\M} } } */
57 /* { dg-final { scan-assembler-not {\mmfvsrd\M} } } */
58 /* { dg-final { scan-assembler-not {\mstw\M} } } */