diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/i386/fpu/e_expl.S | 6 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/e_expl.S | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/i386/fpu/e_expl.S b/sysdeps/i386/fpu/e_expl.S index 74968bb..711c86a 100644 --- a/sysdeps/i386/fpu/e_expl.S +++ b/sysdeps/i386/fpu/e_expl.S @@ -122,6 +122,12 @@ ENTRY(IEEE754_EXPL) normal. */ cmpl $0x0001, %eax jge 2f + /* Force underflow and return the argument, to avoid wrong signs + of zero results from the code below in some rounding modes. */ + fld %st + fmul %st + fstp %st + jmp 2f #else movzwl 4+8(%esp), %eax andl $0x7fff, %eax diff --git a/sysdeps/x86_64/fpu/e_expl.S b/sysdeps/x86_64/fpu/e_expl.S index 866bad2..14dd29d 100644 --- a/sysdeps/x86_64/fpu/e_expl.S +++ b/sysdeps/x86_64/fpu/e_expl.S @@ -119,6 +119,12 @@ ENTRY(IEEE754_EXPL) normal. */ cmpl $0x0001, %eax jge 2f + /* Force underflow and return the argument, to avoid wrong signs + of zero results from the code below in some rounding modes. */ + fld %st + fmul %st + fstp %st + jmp 2f #else movzwl 8+8(%rsp), %eax andl $0x7fff, %eax |