]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Domain of opcode is not large enough so test for overflow and handle it.
authorUlrich Drepper <drepper@redhat.com>
Sun, 13 Feb 2000 19:38:55 +0000 (19:38 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 13 Feb 2000 19:38:55 +0000 (19:38 +0000)
sysdeps/libm-i387/s_cosf.S
sysdeps/libm-i387/s_sinf.S
sysdeps/libm-i387/s_tanf.S

index d8e80906393613cf5ac788e22a3b61c84fde5e7b..21f87aa87462daaaad6c84ea7a2a455239ab392e 100644 (file)
@@ -7,10 +7,23 @@
 
 RCSID("$NetBSD: s_cosf.S,v 1.3 1995/05/08 23:55:16 jtc Exp $")
 
-/* A float's domain isn't large enough to require argument reduction. */
 ENTRY(__cosf)
        flds    4(%esp)
        fcos
+       fnstsw  %ax
+       testl   $0x400,%eax
+       jnz     1f
+       ret
+       .align ALIGNARG(4)
+1:     fldpi
+       fadd    %st(0)
+       fxch    %st(1)
+2:     fprem1
+       fnstsw  %ax
+       testl   $0x400,%eax
+       jnz     2b
+       fstp    %st(1)
+       fcos
        ret
 END (__cosf)
 weak_alias (__cosf, cosf)
index a010d60f5ef4e53fb2381c73a02214a66d122932..5ca45f52e2c2c00a14b34596ebcd5ba83cef0d5a 100644 (file)
@@ -7,10 +7,23 @@
 
 RCSID("$NetBSD: s_sinf.S,v 1.3 1995/05/09 00:27:53 jtc Exp $")
 
-/* A float's domain isn't large enough to require argument reduction. */
 ENTRY(__sinf)
        flds    4(%esp)
        fsin
+       fnstsw  %ax
+       testl   $0x400,%eax
+       jnz     1f
+       ret
+       .align ALIGNARG(4)
+1:     fldpi
+       fadd    %st(0)
+       fxch    %st(1)
+2:     fprem1
+       fnstsw  %ax
+       testl   $0x400,%eax
+       jnz     2b
+       fstp    %st(1)
+       fsin
        ret
 END (__sinf)
 weak_alias (__sinf, sinf)
index 7a7509119b9f3546e8ef46ee376b5d82d124c2ef..355dff9c8daba9b14b2815218fb9ac050e53eea1 100644 (file)
@@ -7,10 +7,23 @@
 
 RCSID("$NetBSD: s_tanf.S,v 1.3 1995/05/09 00:31:09 jtc Exp $")
 
-/* A float's domain isn't large enough to require argument reduction. */
 ENTRY(__tanf)
        flds    4(%esp)
        fptan
+       fnstsw  %ax
+       testl   $0x400,%eax
+       jnz     1f
+       fstp    %st(0)
+       ret
+1:     fldpi
+       fadd    %st(0)
+       fxch    %st(1)
+2:     fprem1
+       fstsw   %ax
+       testl   $0x400,%eax
+       jnz     2b
+       fstp    %st(1)
+       fptan
        fstp    %st(0)
        ret
 END (__tanf)