diff options
author | Joern Rennecke <amylaar@gcc.gnu.org> | 1996-11-06 03:48:54 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 1996-11-06 03:48:54 +0000 |
commit | 24c50999b5af9cd09fb72f22d8d1c2f46772df2e (patch) | |
tree | f556ea31bf966ad2a8fe746496ce3f70b7992afd | |
parent | 62acf5fda199986b46c9e3c6a510adab77ae8b49 (diff) | |
download | gcc-24c50999b5af9cd09fb72f22d8d1c2f46772df2e.zip gcc-24c50999b5af9cd09fb72f22d8d1c2f46772df2e.tar.gz gcc-24c50999b5af9cd09fb72f22d8d1c2f46772df2e.tar.bz2 |
(gen_shl_and): Try to generate shorter constant for and.
From-SVN: r13101
-rw-r--r-- | gcc/config/sh/sh.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index cafbc51..c1bfc0e 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1273,6 +1273,11 @@ gen_shl_and (dest, left_rtx, mask_rtx, source) shift_gen_fun = gen_shifty_op; case 2: case 3: + /* If the topmost bit that matters is set, set the topmost bits + that don't matter. This way, we might be able to get a shorter + signed constant. */ + if (mask & ((HOST_WIDE_INT)1 << 31 - total_shift)) + mask |= (HOST_WIDE_INT)~0 << (31 - total_shift); /* Don't expand fine-grained when combining, because that will make the pattern fail. */ if (rtx_equal_function_value_matters |