Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/bcd-1.c

raw
1 /* { dg-do compile { target { powerpc*-*-linux* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power7 -O2" } */
4 /* { dg-require-effective-target powerpc_vsx } */
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" } } */
9
10 unsigned int
11 to_bcd (unsigned int a)
12 {
13 return __builtin_cdtbcd (a);
14 }
15
16 unsigned int
17 from_bcd (unsigned int a)
18 {
19 return __builtin_cbcdtd (a);
20 }
21
22 unsigned int
23 bcd_arith (unsigned int a, unsigned int b)
24 {
25 return __builtin_addg6s (a, b);
26 }