[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr84154-2.c
blob64b355f51b114fea9e5c9e1c9cd40dbe9a8770ed
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2" } */
6 /* PR target/84154. Make sure on ISA 2.07 (power8) that we store the result of
7 a conversion to char/short using an offsettable address does not generate
8 direct moves for storing 32-bit integers, but does do a direct move for
9 8/16-bit integers. */
11 void
12 double_to_uc (double x, unsigned char *p)
14 p[3] = x;
17 void
18 double_to_sc (double x, signed char *p)
20 p[3] = x;
23 void
24 double_to_us (double x, unsigned short *p)
26 p[3] = x;
29 void
30 double_to_ss (double x, short *p)
32 p[3] = x;
35 void
36 double_to_ui (double x, unsigned int *p)
38 p[3] = x;
41 void
42 double_to_si (double x, int *p)
44 p[3] = x;
47 /* { dg-final { scan-assembler-times {\mfctiwuz\M|\mxscvdpuxws\M} 3 } } */
48 /* { dg-final { scan-assembler-times {\mfctiwz\M|\mxscvdpsxws\M} 3 } } */
49 /* { dg-final { scan-assembler-times {\mmfvsrwz\M} 4 } } */
50 /* { dg-final { scan-assembler-times {\mstfiwx\M|\mstxsiwx\M} 2 } } */
51 /* { dg-final { scan-assembler-times {\mstb\M} 2 } } */
52 /* { dg-final { scan-assembler-times {\msth\M} 2 } } */
53 /* { dg-final { scan-assembler-not {\mlbz\M} } } */
54 /* { dg-final { scan-assembler-not {\mlhz\M} } } */
55 /* { dg-final { scan-assembler-not {\mlha\M} } } */
56 /* { dg-final { scan-assembler-not {\mmfvsrd\M} } } */
57 /* { dg-final { scan-assembler-not {\mstw\M} } } */