On 08/23/2017 04:55 AM, Richard Sandiford wrote: > This patch uses GET_MODE_UNIT_SIZE instead of GET_MODE_SIZE in > cases where, for compound modes, the mode of the scalar elements > is what matters. E.g. the choice between truncation and extension > is really based on the modes of the consistuent scalars rather > than the mode as a whole. > > None of the existing code was wrong. The patch simply makes > things easier when converting to variable-sized modes. > > Tested on aarch64-linux-gnu and x86_64-linux-gnu, and by making sure > that there were no differences in testsuite assembly output for one > target per CPU. OK to install? > > Richard > > > 2017-08-22 Richard Sandiford <richard.sandif...@linaro.org> > Alan Hayward <alan.hayw...@arm.com> > David Sherwood <david.sherw...@arm.com> > > gcc/ > * optabs.c (add_equal_note): Use GET_MODE_UNIT_SIZE. > (widened_mode): Likewise. > (expand_unop): Likewise. > * ree.c (transform_ifelse): Likewise. > (merge_def_and_ext): Likewise. > (combine_reaching_defs): Likewise. > * simplify-rtx.c (simplify_unary_operation_1): Likewise. OK.
Presumably when you get to the point where you introduce variable sized modes, you'll document some kind of guidelines for using GET_MODE_SIZE vs GET_MODE_UNIT_SIZE. I can see this becoming a bit of wack-a-mole if we're not careful. jeff