about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S')
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
index cee4c7b239..27673b67e1 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
@@ -52,19 +52,21 @@ ENTRY (__nearbyint)
 	bgelr	cr7
 	fcmpu	cr7,fp1,fp12	/* if (x > 0.0 */
 	ble	cr7,L(lessthanzero)
+	mffs	fp11
 	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
 	fadd	fp1,fp1,fp13	/* x += TWO52 */
 	fsub	fp1,fp1,fp13	/* x -= TWO52 */
 	fabs	fp1,fp1		/* if (x == 0.0 */
-	mtfsb0	4*cr1+eq	/* Clear any FE_INEXACT exception */
+	mtfsf	0xff,fp11	/* Restore FE_INEXACT state.  */
 	blr
 L(lessthanzero):
 	bgelr	cr7
+	mffs	fp11
 	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
 	fsub	fp1,fp1,fp13	/* x -= TWO52 */
 	fadd	fp1,fp1,fp13	/* x += TWO52 */
 	fnabs	fp1,fp1		/* if (x == 0.0) */
-	mtfsb0	4*cr1+eq	/* Clear any FE_INEXACT exception */
+	mtfsf	0xff,fp11	/* Restore FE_INEXACT state.  */
 	blr
 END (__nearbyint)