This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add more subreg offset helpers


> 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.sandiford@arm.com>
> 	    Alan Hayward  <alan.hayward@arm.com>
> 	    David Sherwood  <david.sherwood@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]