blob: 00a6f84c3d897fdea3463e35a989710be6b24129 [file] [log] [blame]
/* { dg-do compile { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=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);
}