Re: Add more subreg offset helpers

2016-11-22 Thread Eric Botcazou
> 2016-11-15 Richard Sandiford > Alan Hayward > David Sherwood > > * rtl.h (subreg_size_offset_from_lsb): Declare. > (subreg_offset_from_lsb): New function. > (subreg_size_lowpart_offset): Declare. > (subreg_lowpart_offset): Turn into an inline fu

Re: Add more subreg offset helpers

2016-11-22 Thread Richard Sandiford
Eric Botcazou writes: >> subreg_offset_from_lsb was supposed to be the inverse operation of >> subreg_lsb, which also returns a bit number. > > It would have helped the reviewer to state it in the function comment. ;-) > >> Should I change that to return a byte number as well? > > Both functions a

Re: Add more subreg offset helpers

2016-11-16 Thread Eric Botcazou
> subreg_offset_from_lsb was supposed to be the inverse operation of > subreg_lsb, which also returns a bit number. It would have helped the reviewer to state it in the function comment. ;-) > Should I change that to return a byte number as well? Both functions are fine as-is, but mention that t

Re: Add more subreg offset helpers

2016-11-16 Thread Richard Sandiford
Eric Botcazou writes: >> 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 a

Re: Add more subreg offset helpers

2016-11-16 Thread Eric Botcazou
> 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 r