Files
semi-libc/src/math/x32/fmodl.s
T
Szabolcs Nagy a732e80d33 math: fix x86_64 and x32 asm not to use sahf instruction
Some early x86_64 cpus (released before 2006) did not support sahf/lahf
instructions so they should be avoided (intel manual says they are only
supported if CPUID.80000001H:ECX.LAHF-SAHF[bit 0] = 1).

The workaround simplifies exp2l and expm1l because fucomip can be
used instead of the fucomp;fnstsw;sahf sequence copied from i386.

In fmodl and remainderl sahf is replaced by a simple bit test.
2014-11-05 21:40:29 +01:00

12 lines
132 B
ArmAsm

.global fmodl
.type fmodl,@function
fmodl:
fldt 24(%esp)
fldt 8(%esp)
1: fprem
fstsw %ax
testb $4,%ah
jnz 1b
fstp %st(1)
ret