blob: b4f3fb2c879b262d8f10becc6212646240709a6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/* { dg-do compile { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
/* { dg-options "-mcpu=power7 -O2" } */
/* { dg-final { scan-assembler-times "cdtbcd " 1 } } */
/* { dg-final { scan-assembler-times "cbcdtd " 1 } } */
/* { dg-final { scan-assembler-times "addg6s " 1 } } */
/* { dg-final { scan-assembler-not "bl __builtin" } } */
unsigned int
to_bcd (unsigned int a)
{
return __builtin_cdtbcd (a);
}
unsigned int
from_bcd (unsigned int a)
{
return __builtin_cbcdtd (a);
}
unsigned int
bcd_arith (unsigned int a, unsigned int b)
{
return __builtin_addg6s (a, b);
}
|