Cygwin: ilogbl: Make sure to return FP_ILGB0 on zero input
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
013e445fa4
commit
9ccc706bdd
|
@ -23,6 +23,8 @@ __MINGW_USYMBOL(ilogbl):
|
||||||
andb %ah, %dh
|
andb %ah, %dh
|
||||||
cmpb $0x05, %dh
|
cmpb $0x05, %dh
|
||||||
je 1f /* Is +-Inf, jump. */
|
je 1f /* Is +-Inf, jump. */
|
||||||
|
cmpb $0x40, %dh
|
||||||
|
je 2f /* Is +-Inf, jump. */
|
||||||
|
|
||||||
fxtract
|
fxtract
|
||||||
pushq %rax
|
pushq %rax
|
||||||
|
@ -37,6 +39,9 @@ __MINGW_USYMBOL(ilogbl):
|
||||||
1: fstp %st
|
1: fstp %st
|
||||||
movl $0x7fffffff, %eax
|
movl $0x7fffffff, %eax
|
||||||
ret
|
ret
|
||||||
|
2: fstp %st
|
||||||
|
movl $0x80000001, %eax /* FP_ILOGB0 */
|
||||||
|
ret
|
||||||
#else
|
#else
|
||||||
fldt 4(%esp)
|
fldt 4(%esp)
|
||||||
/* I added the following ugly construct because ilogb(+-Inf) is
|
/* I added the following ugly construct because ilogb(+-Inf) is
|
||||||
|
@ -48,6 +53,8 @@ __MINGW_USYMBOL(ilogbl):
|
||||||
andb %ah, %dh
|
andb %ah, %dh
|
||||||
cmpb $0x05, %dh
|
cmpb $0x05, %dh
|
||||||
je 1f /* Is +-Inf, jump. */
|
je 1f /* Is +-Inf, jump. */
|
||||||
|
cmpb $0x40, %dh
|
||||||
|
je 2f /* Is +-Inf, jump. */
|
||||||
|
|
||||||
fxtract
|
fxtract
|
||||||
pushl %eax
|
pushl %eax
|
||||||
|
@ -62,4 +69,7 @@ __MINGW_USYMBOL(ilogbl):
|
||||||
1: fstp %st
|
1: fstp %st
|
||||||
movl $0x7fffffff, %eax
|
movl $0x7fffffff, %eax
|
||||||
ret
|
ret
|
||||||
|
2: fstp %st
|
||||||
|
movl $0x80000001, %eax /* FP_ILOGB0 */
|
||||||
|
ret
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -108,3 +108,6 @@ Bug Fixes
|
||||||
- Fix an assertion failure when /cygdrive contains an offline network
|
- Fix an assertion failure when /cygdrive contains an offline network
|
||||||
drive.
|
drive.
|
||||||
Addresses: https://cygwin.com/ml/cygwin/2019-12/msg00016.html
|
Addresses: https://cygwin.com/ml/cygwin/2019-12/msg00016.html
|
||||||
|
|
||||||
|
- Fix return value of ilogbl for 0 input.
|
||||||
|
Addresses: https://cygwin.com/ml/cygwin/2019-12/msg00074.html
|
||||||
|
|
Loading…
Reference in New Issue