about summary refs log tree commit diff
path: root/soft-fp
diff options
context:
space:
mode:
Diffstat (limited to 'soft-fp')
-rw-r--r--soft-fp/op-4.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/soft-fp/op-4.h b/soft-fp/op-4.h
index 3515bdc497..6c6b461166 100644
--- a/soft-fp/op-4.h
+++ b/soft-fp/op-4.h
@@ -709,7 +709,7 @@
       else if (rsize <= 2*_FP_W_TYPE_SIZE)				\
 	{								\
 	  r = X##_f[1];							\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[0];						\
 	}								\
       else								\
@@ -717,11 +717,11 @@
 	  /* I'm feeling lazy so we deal with int == 3words (implausible)*/ \
 	  /* and int == 4words as a single case.			 */ \
 	  r = X##_f[3];							\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[2];						\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[1];						\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[0];						\
 	}								\
     }									\