diff options
author | Adam Nemet <anemet@caviumnetworks.com> | 2009-07-18 21:48:19 +0000 |
---|---|---|
committer | Adam Nemet <nemet@gcc.gnu.org> | 2009-07-18 21:48:19 +0000 |
commit | 3e63dd3a366d314071d1568917c5a9887d113d68 (patch) | |
tree | d2ca640a0b4806375951e0d2cc773e62985e8754 | |
parent | b641d7fca3c917bd40da5de8e9f16876bdd4a5df (diff) | |
download | gcc-3e63dd3a366d314071d1568917c5a9887d113d68.zip gcc-3e63dd3a366d314071d1568917c5a9887d113d68.tar.gz gcc-3e63dd3a366d314071d1568917c5a9887d113d68.tar.bz2 |
combine.c (try_widen_shift_mode): Allow widening if the high-order bits are zero.
* combine.c (try_widen_shift_mode) <LSHIFTRT>: Allow widening if the
high-order bits are zero.
From-SVN: r149779
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/combine.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9643005..1c418d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2009-07-18 Adam Nemet <anemet@caviumnetworks.com> + * combine.c (try_widen_shift_mode) <LSHIFTRT>: Allow widening if the + high-order bits are zero. + +2009-07-18 Adam Nemet <anemet@caviumnetworks.com> + * combine.c (simplify_shift_const_1): Split code to determine shift_mode into ... (try_widen_shift_mode): ... here. Allow widening for ASHIFTRT if the diff --git a/gcc/combine.c b/gcc/combine.c index a0157df..12f0ed8 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -9005,8 +9005,15 @@ try_widen_shift_mode (enum rtx_code code, rtx op, > (unsigned) (GET_MODE_BITSIZE (mode) - GET_MODE_BITSIZE (orig_mode))) return mode; - /* fall through */ + return orig_mode; + case LSHIFTRT: + /* Similarly here but with zero bits. */ + if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT + && (nonzero_bits (op, mode) & ~GET_MODE_MASK (orig_mode)) == 0) + return mode; + /* fall through */ + case ROTATE: return orig_mode; |