瀏覽代碼

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

Rich Felker 13 年之前
父節點
當前提交
1295848efb
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/math/i386/sqrt.s

+ 3 - 4
src/math/i386/sqrt.s

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