VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: David S. Miller <davem@sunset.davemloft.net> 2007-08-16 22:59:49 -0700 committer: David S. Miller <davem@sunset.davemloft.net> 2007-08-16 22:59:49 -0700 commit: 405849610fd96b4f34cd1875c4c033228fea6c0f parent: 8b224b813aad0231af62dc75d056aae83c9d4d12
Commit Summary:
[MATH-EMU]: Fix underflow exception reporting.
Diffstat:
1 file changed, 4 insertions, 1 deletion
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index 93780abd01bc..bb46e7645d53 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -145,13 +145,16 @@ do {								\
 	      {							\
 	        X##_e = 1;					\
 	        _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
+	        FP_SET_EXCEPTION(FP_EX_INEXACT);		\
 	      }							\
 	    else						\
 	      {							\
 		X##_e = 0;					\
 		_FP_FRAC_SRL_##wc(X, _FP_WORKBITS);		\
-		FP_SET_EXCEPTION(FP_EX_UNDERFLOW);		\
 	      }							\
+	    if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) ||		\
+		(FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))	\
+		FP_SET_EXCEPTION(FP_EX_UNDERFLOW);		\
 	  }							\
 	else							\
 	  {							\