diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 11:17:12 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:17:12 +0000 |
commit | 401581b6eb93369a5e60c05e9f13d072ba23cff4 (patch) | |
tree | 6f33c3a098eadeec40ab3a1d2b8e5a10578f856d /gcc/rtlanal.c | |
parent | f8265fb8e8e12c92eab0393488824bfb788ebfff (diff) | |
download | gcc-401581b6eb93369a5e60c05e9f13d072ba23cff4.zip gcc-401581b6eb93369a5e60c05e9f13d072ba23cff4.tar.gz gcc-401581b6eb93369a5e60c05e9f13d072ba23cff4.tar.bz2 |
[49/77] Simplify nonzero/num_sign_bits hooks
The two implementations of the reg_nonzero_bits and reg_num_sign_bits
hooks ignored the "known_x", "known_mode" and "known_ret" arguments,
so this patch removes them. It adds a new scalar_int_mode parameter
that specifies the mode of "x". (This mode might be different from
"mode", which is the mode in which "x" is used.)
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* rtl.h (rtl_hooks::reg_nonzero_bits): Add a scalar_int_mode
parameter for the mode of "x". Remove the "known_x", "known_mode"
and "known_ret" arguments. Change the type of the mode argument
to scalar_int_mode.
(rtl_hooks:reg_num_sign_bit_copies): Likewise.
* combine.c (reg_nonzero_bits_for_combine): Update accordingly.
(reg_num_sign_bit_copies_for_combine): Likewise.
* rtlanal.c (nonzero_bits1): Likewise.
(num_sign_bit_copies1): Likewise.
* rtlhooks-def.h (reg_nonzero_bits_general): Likewise.
(reg_num_sign_bit_copies_general): Likewise.
* rtlhooks.c (reg_num_sign_bit_copies_general): Likewise.
(reg_nonzero_bits_general): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251501
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 605fd97..3066ae2 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -4449,9 +4449,8 @@ nonzero_bits1 (const_rtx x, scalar_int_mode mode, const_rtx known_x, { unsigned HOST_WIDE_INT nonzero_for_hook = nonzero; - rtx new_rtx = rtl_hooks.reg_nonzero_bits (x, mode, known_x, - known_mode, known_ret, - &nonzero_for_hook); + rtx new_rtx = rtl_hooks.reg_nonzero_bits (x, xmode, mode, + &nonzero_for_hook); if (new_rtx) nonzero_for_hook &= cached_nonzero_bits (new_rtx, mode, known_x, @@ -4943,9 +4942,8 @@ num_sign_bit_copies1 (const_rtx x, scalar_int_mode mode, const_rtx known_x, { unsigned int copies_for_hook = 1, copies = 1; - rtx new_rtx = rtl_hooks.reg_num_sign_bit_copies (x, mode, known_x, - known_mode, known_ret, - &copies_for_hook); + rtx new_rtx = rtl_hooks.reg_num_sign_bit_copies (x, xmode, mode, + &copies_for_hook); if (new_rtx) copies = cached_num_sign_bit_copies (new_rtx, mode, known_x, |