diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-10-22 21:11:01 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-10-22 21:11:01 +0000 |
commit | 1e3734f59eee29ed335da8fc9f40e66903f64b20 (patch) | |
tree | 51203651e08ac8824d7052d06963b16ff7492539 /gcc/simplify-rtx.c | |
parent | e10326ff910ab337741d0781a536435d51c5f044 (diff) | |
download | gcc-1e3734f59eee29ed335da8fc9f40e66903f64b20.zip gcc-1e3734f59eee29ed335da8fc9f40e66903f64b20.tar.gz gcc-1e3734f59eee29ed335da8fc9f40e66903f64b20.tar.bz2 |
Make more use of HWI_COMPUTABLE_MODE_P
This patch uses HWI_COMPUTABLE_MODE_P (X) instead of
GET_MODE_PRECISION (X) <= HOST_BITS_PER_WIDE_INT in cases
where X also needs to be a scalar integer.
2017-10-22 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* combine.c (simplify_comparison): Use HWI_COMPUTABLE_MODE_P.
(record_promoted_value): Likewise.
* expr.c (expand_expr_real_2): Likewise.
* ree.c (update_reg_equal_equiv_notes): Likewise.
(combine_set_extension): Likewise.
* rtlanal.c (low_bitmask_len): Likewise.
* simplify-rtx.c (neg_const_int): Likewise.
(simplify_binary_operation_1): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r253990
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index c4d6ce7..ba6b225b 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -62,7 +62,7 @@ neg_const_int (machine_mode mode, const_rtx i) { unsigned HOST_WIDE_INT val = -UINTVAL (i); - if (GET_MODE_PRECISION (mode) > HOST_BITS_PER_WIDE_INT + if (!HWI_COMPUTABLE_MODE_P (mode) && val == UINTVAL (i)) return simplify_const_unary_operation (NEG, mode, CONST_CAST_RTX (i), mode); @@ -3341,7 +3341,8 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode, if (trueop0 == CONST0_RTX (mode) && ! side_effects_p (op1)) return op0; /* Rotating ~0 always results in ~0. */ - if (CONST_INT_P (trueop0) && width <= HOST_BITS_PER_WIDE_INT + if (CONST_INT_P (trueop0) + && HWI_COMPUTABLE_MODE_P (mode) && UINTVAL (trueop0) == GET_MODE_MASK (mode) && ! side_effects_p (op1)) return op0; @@ -3420,7 +3421,7 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode, goto canonicalize_shift; case SMIN: - if (width <= HOST_BITS_PER_WIDE_INT + if (HWI_COMPUTABLE_MODE_P (mode) && mode_signbit_p (mode, trueop1) && ! side_effects_p (op0)) return op1; @@ -3432,7 +3433,7 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode, break; case SMAX: - if (width <= HOST_BITS_PER_WIDE_INT + if (HWI_COMPUTABLE_MODE_P (mode) && CONST_INT_P (trueop1) && (UINTVAL (trueop1) == GET_MODE_MASK (mode) >> 1) && ! side_effects_p (op0)) |