* combine.c (make_extraction): Reapply to the argument of an ASHIFT.
authorRichard Sandiford <rsandifo@redhat.com>
Thu, 20 Jun 2002 18:04:00 +0000 (18:04 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 20 Jun 2002 18:04:00 +0000 (18:04 +0000)
From-SVN: r54846

gcc/ChangeLog
gcc/combine.c

index b7fb3767c634b3a837e9e214f372768555eee49a..4a42c58bad6b77442efc202f16850ae6da4773ec 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-20  Richard Sandiford  <rsandifo@redhat.com>
+
+       * combine.c (make_extraction): Reapply to the argument of an ASHIFT.
+
 2002-06-20  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        * config/sparc/t-crtfm (crtfastmath.o): Prefix with $(T) for
index 3b298827413c82a6b09021892b94f98a31ede12c..ea12b1309227c9cdf5343b33d3a39ba4df92dc14 100644 (file)
@@ -5968,6 +5968,21 @@ make_extraction (mode, inner, pos, pos_rtx, len,
        is_mode = GET_MODE (SUBREG_REG (inner));
       inner = SUBREG_REG (inner);
     }
+  else if (GET_CODE (inner) == ASHIFT
+          && GET_CODE (XEXP (inner, 1)) == CONST_INT
+          && pos_rtx == 0 && pos == 0
+          && len > INTVAL (XEXP (inner, 1)))
+    {
+      /* We're extracting the least significant bits of an rtx
+        (ashift X (const_int C)), where LEN > C.  Extract the
+        least significant (LEN - C) bits of X, giving an rtx
+        whose mode is MODE, then shift it left C times.  */
+      new = make_extraction (mode, XEXP (inner, 0),
+                            0, 0, len - INTVAL (XEXP (inner, 1)),
+                            unsignedp, in_dest, in_compare);
+      if (new != 0)
+       return gen_rtx_ASHIFT (mode, new, XEXP (inner, 1));
+    }
 
   inner_mode = GET_MODE (inner);