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.
12 lines
132 B
ArmAsm
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
|