2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
11 modfl (long double value
, long double* iptr
)
13 long double int_part
= 0.0L;
15 #if defined(_AMD64_) || defined(__x86_64__)
16 asm volatile ("subq $8, %%rsp\n"
18 "movzwl 4(%%rsp), %%eax\n"
20 "movw %%ax, (%%rsp)\n"
24 "addq $8, %%rsp\n" : "=t" (int_part
) : "0" (value
) : "eax"); /* round */
25 #elif defined(_X86_) || defined(__i386__)
26 asm volatile ("push %%eax\n\tsubl $8, %%esp\n"
28 "movzwl 4(%%esp), %%eax\n"
30 "movw %%ax, (%%esp)\n"
34 "addl $8, %%esp\n\tpop %%eax\n" : "=t" (int_part
) : "0" (value
) : "eax"); /* round */
36 int_part
= truncl(value
);
40 return (isinf (value
) ? 0.0L : value
- int_part
);