This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Move stuff to simplify-rtx.c, 5/13 - FLOAT_EXTEND


This patch is the one I had already sent, split into thirteen pieces. I hope it's easier to review it. This one moves FLOAT_EXTEND simplifications to simplify-rtx.c.

The patch set was bootstrapped and regtested all in one, on powerpc-apple-darwin8.3.0 and i686-pc-linux-gnu.

Paolo
diff -paura combine-float-truncate/combine.c combine-float-extend/combine.c
--- combine-float-truncate/combine.c	2005-12-13 20:59:04.000000000 +0100
+++ combine-float-extend/combine.c	2005-12-13 22:33:11.000000000 +0100
@@ -4224,23 +4224,6 @@ combine_simplify_rtx (rtx x, enum machin
 
       break;
 
-    case FLOAT_EXTEND:
-      /*  (float_extend (float_extend x)) is (float_extend x)
-
-	  (float_extend (float x)) is (float x) assuming that double
-	  rounding can't happen.
-          */
-      if (GET_CODE (XEXP (x, 0)) == FLOAT_EXTEND
-	  || (GET_CODE (XEXP (x, 0)) == FLOAT
-	      && ((unsigned)significand_size (GET_MODE (XEXP (x, 0)))
-		  >= (GET_MODE_BITSIZE (GET_MODE (XEXP (XEXP (x, 0), 0)))
-		      - num_sign_bit_copies (XEXP (XEXP (x, 0), 0),
-					     GET_MODE (XEXP (XEXP (x, 0), 0)))))))
-	return simplify_gen_unary (GET_CODE (XEXP (x, 0)), mode,
-				   XEXP (XEXP (x, 0), 0),
-				   GET_MODE (XEXP (XEXP (x, 0), 0)));
-
-      break;
 #ifdef HAVE_cc0
     case COMPARE:
       /* Convert (compare FOO (const_int 0)) to FOO unless we aren't
diff -paura combine-float-truncate/simplify-rtx.c combine-float-extend/simplify-rtx.c
--- combine-float-truncate/simplify-rtx.c	2005-12-13 20:59:00.000000000 +0100
+++ combine-float-extend/simplify-rtx.c	2005-12-13 22:33:09.000000000 +0100
@@ -698,5 +698,23 @@ simplify_unary_operation_1 (enum rtx_cod
 	  && GET_CODE (SUBREG_REG (op)) == FLOAT_TRUNCATE)
 	return SUBREG_REG (op);
       break;
+
+    case FLOAT_EXTEND:
+      /*  (float_extend (float_extend x)) is (float_extend x)
+
+	  (float_extend (float x)) is (float x) assuming that double
+	  rounding can't happen.
+          */
+      if (GET_CODE (op) == FLOAT_EXTEND
+	  || (GET_CODE (op) == FLOAT
+	      && ((unsigned)significand_size (GET_MODE (op))
+		  >= (GET_MODE_BITSIZE (GET_MODE (XEXP (op, 0)))
+		      - num_sign_bit_copies (XEXP (op, 0),
+					     GET_MODE (XEXP (op, 0)))))))
+	return simplify_gen_unary (GET_CODE (op), mode,
+				   XEXP (op, 0),
+				   GET_MODE (XEXP (op, 0)));
+
+      break;
 
     case SIGN_EXTEND:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]