summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-06 13:36:16 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-06 13:36:16 +0000
commit6f061208fc5d6d1cdb668fb56b84249d1c96b3a1 (patch)
treedac9f2b9f9f4e057938eba339861f1b99af29cc2 /gcc/combine.c
parent321583cbf3a8135b2d17cdb1eae83e66c60ac689 (diff)
downloadgcc-6f061208fc5d6d1cdb668fb56b84249d1c96b3a1.tar.gz
* simplify-rtx.c (simplify_const_binary_operation): Use the
shift_truncation_mask hook instead of performing modulo by width. Compare against mode precision, not bitsize. * combine.c (combine_simplify_rtx, simplify_shift_const_1): Use shift_truncation_mask instead of constructing the value manually. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175913 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index ba35f280fcd..737f300b063 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5946,9 +5946,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest,
else if (SHIFT_COUNT_TRUNCATED && !REG_P (XEXP (x, 1)))
SUBST (XEXP (x, 1),
force_to_mode (XEXP (x, 1), GET_MODE (XEXP (x, 1)),
- ((unsigned HOST_WIDE_INT) 1
- << exact_log2 (GET_MODE_BITSIZE (GET_MODE (x))))
- - 1,
+ targetm.shift_truncation_mask (GET_MODE (x)),
0));
break;
@@ -9901,7 +9899,7 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
want to do this inside the loop as it makes it more difficult to
combine shifts. */
if (SHIFT_COUNT_TRUNCATED)
- orig_count &= GET_MODE_BITSIZE (mode) - 1;
+ orig_count &= targetm.shift_truncation_mask (mode);
/* If we were given an invalid count, don't do anything except exactly
what was requested. */