Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/x86_64/gen Fix fpsetmask(3) to be able to clea...



details:   https://anonhg.NetBSD.org/src/rev/66e4d00e7792
branches:  trunk
changeset: 770514:66e4d00e7792
user:      njoly <njoly%NetBSD.org@localhost>
date:      Wed Oct 19 15:24:58 2011 +0000

description:
Fix fpsetmask(3) to be able to clear bits previously set.

diffstat:

 lib/libc/arch/x86_64/gen/fpsetmask.S |  31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diffs (48 lines):

diff -r 91975af15d54 -r 66e4d00e7792 lib/libc/arch/x86_64/gen/fpsetmask.S
--- a/lib/libc/arch/x86_64/gen/fpsetmask.S      Wed Oct 19 14:42:37 2011 +0000
+++ b/lib/libc/arch/x86_64/gen/fpsetmask.S      Wed Oct 19 15:24:58 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpsetmask.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $       */
+/*     $NetBSD: fpsetmask.S,v 1.4 2011/10/19 15:24:58 njoly Exp $      */
 
 /*
  * Written by Frank van der Linden at Wasabi Systems for NetBSD.
@@ -20,22 +20,25 @@
 #else
 ENTRY(fpsetmask)
 #endif
-       fnstcw  -4(%rsp)
-       stmxcsr -8(%rsp)
-       andl    $63,%edi
        notl    %edi
+       andl    $0x0000003f,%edi
 
-       movl    -4(%rsp),%edx
-       movl    %edx,%eax
-       andl    %edi,%edx
+       fnstcw  -4(%rsp)
+       movl    -4(%rsp), %edx
+       movl    %edx, %eax
+       andl    $0xffffffc0, %edx
+       orl     %edi, %edx
        movl    %edx,-4(%rsp)
+       fldcw   -4(%rsp)
 
-       movl    -8(%rsp),%edx
-       roll    $7,%edi
-       andl    %edi,%edx
-       movl    %edx,-8(%rsp)
+       stmxcsr -4(%rsp)
+       movl    -4(%rsp), %edx
+       andl    $0xfffff07f, %edx
+       sall    $7, %edi
+       orl     %edi, %edx
+       movl    %edx,-4(%rsp)
+       ldmxcsr -4(%rsp)
 
-       fldcw   -4(%rsp)
-       ldmxcsr -8(%rsp)
-       andl    $63,%eax
+       notl    %eax
+       andl    $0x0000003f, %eax
        ret



Home | Main Index | Thread Index | Old Index