Jeff Law <l...@redhat.com> writes: > On 11/15/2016 05:42 AM, Richard Sandiford wrote: >> LOAD_EXTEND_OP only applies to scalar integer modes that are narrower >> than a word. However, callers weren't consistent about which of these >> checks they made beforehand, and also weren't consistent about whether >> "smaller" was based on (bit)size or precision (IMO it's the latter). >> This patch adds a wrapper to try to make the macro easier to use. > It's unclear to me how GET_MODE_PRECISION is different from > GET_MODE_SIZE or GET_MODE_BITSIZE. But I haven't really thought about > it, particularly in the context of vector modes and such. I'm certainly > willing to trust your judgment on this.
In this case it's really more about scalar integer modes than vector modes. I think using size and precision are equivalent for MODE_INT but they can be different for MODE_PARTIAL_INT. Using precision allows LOAD_EXTEND_OP to apply to (say) PSImode extensions to SImode, whereas using the size wouldn't, since PSImode and SImode have the same (memory) size. >> The patch doesn't change reload, since different checks could have >> unforeseen consequences. > I think the same concepts apply in reload, but I understand the > hesitation to twiddle that code and deal with possible fallout. Yeah :-) I know it's a bit of a cop-out, but given the scale of the SVE changes as a whole, we didn't want to go looking for unnecessary trouble. >> Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? >> >> Thanks, >> Richard >> >> >> [ This patch is part of the SVE series posted here: >> https://gcc.gnu.org/ml/gcc/2016-11/msg00030.html ] >> >> gcc/ >> 2016-11-15 Richard Sandiford <richard.sandif...@arm.com> >> Alan Hayward <alan.hayw...@arm.com> >> David Sherwood <david.sherw...@arm.com> >> >> * rtl.h (load_extend_op): Declare. >> * rtlanal.c (load_extend_op): New function. >> (nonzero_bits1): Use it. >> (num_sign_bit_copies1): Likewise. >> * cse.c (cse_insn): Likewise. >> * fold-const.c (fold_single_bit_test): Likewise. >> (fold_unary_loc): Likewise. >> * fwprop.c (free_load_extend): Likewise. >> * postreload.c (reload_cse_simplify_set): Likewise. >> (reload_cse_simplify_operands): Likewise. >> * combine.c (try_combine): Likewise. >> (simplify_set): Likewise. Remove redundant SUBREG_BYTE and >> subreg_lowpart_p checks. > OK. > jeff Thanks, Richard