diff options
Diffstat (limited to 'mdk-stage1/dietlibc/i386/cos.S')
-rw-r--r-- | mdk-stage1/dietlibc/i386/cos.S | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/mdk-stage1/dietlibc/i386/cos.S b/mdk-stage1/dietlibc/i386/cos.S index 73ba03355..f95c81ca7 100644 --- a/mdk-stage1/dietlibc/i386/cos.S +++ b/mdk-stage1/dietlibc/i386/cos.S @@ -7,16 +7,27 @@ cosf: flds 4(%esp) - jmp .Lcos + jmp 1f cos: fldl 4(%esp) -.Lcos: - call __fmod2pi +1: fcos - ret + fnstsw %ax + testb $0x04, %ah + je 3f + fldpi + fadd %st + fxch %st(1) +2: fprem1 + fnstsw %ax + testb $0x04, %ah + jne 2b + fstp %st(1) + fcos +3: ret cosl: fldt 4(%esp) - jmp .Lcos + jmp 1b .Lende: .size cos,.Lende-cos |