[PATCH, V3, #4 of 10], Add general prefixed/pcrel support

Segher Boessenkool segher@kernel.crashing.org
Sat Aug 31 14:13:00 GMT 2019


On Sat, Aug 31, 2019 at 10:36:00AM +0930, Alan Modra wrote:
> On Fri, Aug 30, 2019 at 11:35:11AM -0500, Segher Boessenkool wrote:
> > > -	  unsigned HOST_WIDE_INT val = INTVAL (XEXP (addr, 1));
> > > -	  return val + 0x8000 >= 0x10000 - (TARGET_POWERPC64 ? 8 : 12);
> > > +	  HOST_WIDE_INT val = INTVAL (XEXP (addr, 1));
> > > +	  HOST_WIDE_INT extra = TARGET_POWERPC64 ? 8 : 12;
> > 
> > The 8 vs. 12 could use a comment (yes, I know it was there already).  Do you
> > know what this is about, why it is 8 and 12?
> 
> "extra" here covers the increase in offset needed to access the memory
> using multiple registers.  For example, when loading a TImode mem to
> gprs you will load at offset+0 and offset+8 when powerpc64, and
> offset+0, offset+4, offset+8, and offset+12 when powerpc32.

Ah, so it is the size of the mode minus the size of the accesses done to
get it...  16 - UNITS_PER_WORD may be a good way to express it?  I don't
see a way to say it that isn't still helped by a comment though.

Thanks,


Segher



More information about the Gcc-patches mailing list