From 401581b6eb93369a5e60c05e9f13d072ba23cff4 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 30 Aug 2017 11:17:12 +0000 Subject: [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 Alan Hayward David Sherwood 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 Co-Authored-By: David Sherwood From-SVN: r251501 --- gcc/rtl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/rtl.h') diff --git a/gcc/rtl.h b/gcc/rtl.h index 3942577..9e16b9b1 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3779,10 +3779,10 @@ struct rtl_hooks { rtx (*gen_lowpart) (machine_mode, rtx); rtx (*gen_lowpart_no_emit) (machine_mode, rtx); - rtx (*reg_nonzero_bits) (const_rtx, machine_mode, const_rtx, machine_mode, - unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT *); - rtx (*reg_num_sign_bit_copies) (const_rtx, machine_mode, const_rtx, machine_mode, - unsigned int, unsigned int *); + rtx (*reg_nonzero_bits) (const_rtx, scalar_int_mode, scalar_int_mode, + unsigned HOST_WIDE_INT *); + rtx (*reg_num_sign_bit_copies) (const_rtx, scalar_int_mode, scalar_int_mode, + unsigned int *); bool (*reg_truncated_to_mode) (machine_mode, const_rtx); /* Whenever you add entries here, make sure you adjust rtlhooks-def.h. */ -- cgit v1.1