[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / bcd-1.c
blob00a6f84c3d897fdea3463e35a989710be6b24129
1 /* { dg-do compile { target { powerpc*-*-linux* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-mdejagnu-cpu=power7 -O2" } */
5 /* { dg-final { scan-assembler-times "cdtbcd " 1 } } */
6 /* { dg-final { scan-assembler-times "cbcdtd " 1 } } */
7 /* { dg-final { scan-assembler-times "addg6s " 1 } } */
8 /* { dg-final { scan-assembler-not "bl __builtin" } } */
10 unsigned int
11 to_bcd (unsigned int a)
13 return __builtin_cdtbcd (a);
16 unsigned int
17 from_bcd (unsigned int a)
19 return __builtin_cbcdtd (a);
22 unsigned int
23 bcd_arith (unsigned int a, unsigned int b)
25 return __builtin_addg6s (a, b);