diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2002-06-20 18:04:00 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2002-06-20 18:04:00 +0000 |
commit | 988ef418eb9f5d98d7e3290a0a8320091c1fd723 (patch) | |
tree | b3791188472cd83da6f74d3a6c84b9b5808f3d62 | |
parent | 0ab2e54bc3005ade2f8e9fdd8754fc4c2f03f73d (diff) | |
download | gcc-988ef418eb9f5d98d7e3290a0a8320091c1fd723.zip gcc-988ef418eb9f5d98d7e3290a0a8320091c1fd723.tar.gz gcc-988ef418eb9f5d98d7e3290a0a8320091c1fd723.tar.bz2 |
* combine.c (make_extraction): Reapply to the argument of an ASHIFT.
From-SVN: r54846
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/combine.c | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7fb376..4a42c58 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/combine.c b/gcc/combine.c index 3b29882..ea12b13 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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); |