patch-2.1.115 linux/arch/sparc64/math-emu/op-common.h

Next file: linux/arch/sparc64/mm/Makefile
Previous file: linux/arch/sparc64/math-emu/math.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/math-emu/op-common.h linux/arch/sparc64/math-emu/op-common.h
@@ -83,8 +83,17 @@
 	  {							\
 	    _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs);	\
 	    _FP_ROUND(wc, X);					\
-	    X##_e = _FP_FRAC_OVERP_##wc(fs, X);			\
-	    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);			\
+	    _FP_FRAC_SLL_##wc(X, 1);				\
+	    if (_FP_FRAC_OVERP_##wc(fs, X))			\
+	      {							\
+	        X##_e = 1;					\
+	        _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
+	      }							\
+	    else						\
+	      {							\
+		X##_e = 0;					\
+		_FP_FRAC_SRL_##wc(X, _FP_WORKBITS+1);		\
+	      }							\
 	  }							\
 	else							\
 	  {							\

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov