> Provide versions of subreg_lowpart_offset and subreg_highpart_offset > that work on mode sizes rather than modes. Also provide a routine > that converts an lsb position to a subreg offset.
The position is in bits but all the other parameters and the return value are in bytes so IMO this is a recipe for problems. I'd also rename LSB into DIFF or LSB_OFFSET or something equivalent because LSB is not very explicit. > 2016-11-15 Richard Sandiford <richard.sandif...@arm.com> > Alan Hayward <alan.hayw...@arm.com> > David Sherwood <david.sherw...@arm.com> > > * rtl.h (subreg_size_offset_from_lsb): Declare. > (subreg_offset_from_lsb): Likewise. > (subreg_size_lowpart_offset): Likewise. > (subreg_size_highpart_offset): Likewise. > * emit-rtl.c (subreg_size_lowpart_offset): New function. > (subreg_lowpart_offset): Use it. > (subreg_size_highpart_offset): New function. > (subreg_highpart_offset): Use it. > * rtlanal.c (subreg_size_offset_from_lsb): New function. > (subreg_offset_from_lsb): Likewise. Please make the 3 wrappers inline functions. -- Eric Botcazou