simplify nan check in sqrt (x86 asm); result of sqrt is never negative

This commit is contained in:
Rich Felker 2012-03-15 12:16:51 -04:00
parent 5657cc58e5
commit 1295848efb
1 changed files with 3 additions and 4 deletions

View File

@ -10,10 +10,9 @@ sqrt: fldl 4(%esp)
and $0x7ff,%ecx and $0x7ff,%ecx
cmp $0x400,%ecx cmp $0x400,%ecx
jnz 1f jnz 1f
mov 8(%esp),%ecx mov 8(%esp),%cx
or $0xffff8000,%ecx inc %cx
inc %ecx jo 1f
jz 1f
and $0x200,%eax and $0x200,%eax
sub $0x100,%eax sub $0x100,%eax
sub %eax,(%esp) sub %eax,(%esp)