avoid changing NaNs in sqrt (x86 asm) to satisfy c99 f.9 recommendation
authorRich Felker <dalias@aerifal.cx>
Thu, 15 Mar 2012 05:55:54 +0000 (01:55 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 15 Mar 2012 05:55:54 +0000 (01:55 -0400)
src/math/i386/sqrt.s

index 8289d0940f6783d20eb17d9b6350504f46376cfe..331570446ffb56b4ed3580c8260e14d1b272cdcc 100644 (file)
@@ -10,6 +10,10 @@ sqrt:        fldl 4(%esp)
        and $0x7ff,%ecx
        cmp $0x400,%ecx
        jnz 1f
+       mov 8(%esp),%ecx
+       or $0xffff8000,%ecx
+       inc %ecx
+       jz 1f
        and $0x200,%eax
        sub $0x100,%eax
        sub %eax,(%esp)