2 /* This is code generated by xlc -O3 for conversion of a double to an
3 unsigned 32-bit int, in a "floor" style. It relies on doing an
4 fadd with a non-standard rounding mode and so checks that V handles
5 the rounding mode correctly. r will be 1 if that is not so. */
9 extern unsigned int xlc_double_to_u32 ( double );
12 ".global xlc_double_to_u32\n"
13 ".type xlc_double_to_u32, @function\n"
14 "xlc_double_to_u32:\n"
15 " stwu %r1,-48(%r1)\n"
16 " addis %r4,%r0,.const_dr@ha\n"
17 " addis %r0,%r0,17376\n"
22 " lfs %f2,.const_dr@l(%r4)\n"
31 " ori %r0,%r0,0x0000\n"
36 ".size xlc_double_to_u32, . - xlc_double_to_u32\n"
42 " .section \".rodata\",\"a\"\n"
44 " .type .const_dr,@object\n"
45 " .size .const_dr,20\n"
55 int main (int argc
, char** argv
)
57 unsigned int r
= xlc_double_to_u32 ( 0.7 );