This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add more subreg offset helpers
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Sandiford <richard dot sandiford at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 Nov 2016 09:03:37 +0100
- Subject: Re: Add more subreg offset helpers
- Authentication-results: sourceware.org; auth=none
- References: <87shqs1z52.fsf@e105548-lin.cambridge.arm.com>
> 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