diff --git a/lib/msun/i387/s_cos.S b/lib/msun/i387/s_cos.S index 9c3f2caac73b..9951ab0674aa 100644 --- a/lib/msun/i387/s_cos.S +++ b/lib/msun/i387/s_cos.S @@ -40,16 +40,16 @@ ENTRY(cos) fldl 4(%esp) fcos fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fcos ret diff --git a/lib/msun/i387/s_sin.S b/lib/msun/i387/s_sin.S index 11c4d63bbb75..eb047540d736 100644 --- a/lib/msun/i387/s_sin.S +++ b/lib/msun/i387/s_sin.S @@ -40,16 +40,16 @@ ENTRY(sin) fldl 4(%esp) fsin fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fsin ret diff --git a/lib/msun/i387/s_tan.S b/lib/msun/i387/s_tan.S index e31ebdff00a3..182b9f76459e 100644 --- a/lib/msun/i387/s_tan.S +++ b/lib/msun/i387/s_tan.S @@ -40,17 +40,17 @@ ENTRY(tan) fldl 4(%esp) fptan fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f fstp %st(0) ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 - fstsw %ax - andw $0x400,%ax - jnz 2b +2: fprem + fnstsw %ax + sahf + jp 2b fstp %st(1) fptan fstp %st(0)