[PATCH] rs6000: Add basic infrastructure for PC-relative addressing

Bill Schmidt wschmidt@linux.ibm.com
Thu May 23 13:34:00 GMT 2019


On 5/23/19 4:27 AM, Segher Boessenkool wrote:
> Hi!
>
> On Wed, May 22, 2019 at 03:29:17PM -0500, Bill Schmidt wrote:
>> +  /* -mpcrel requires the prefixed load/store support on FUTURE systems.  */
>> +  if (!TARGET_FUTURE && TARGET_PCREL)
>> +    {
>> +      if ((rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0)
>> +	error ("%qs requires %qs", "-mpcrel", "-mcpu=future");
>> +
>> +      rs6000_isa_flags &= ~OPTION_MASK_PCREL;
>> +    }
> The comment is confusing...  I read it as "On FUTURE, pcrel requires
> prefixed load/store".  The code doesn't even mention prefix, anyway.
>
> Just say "-mpcrel requires -mcpu=future", just like the code says?  Or just
> "-mpcrel requires prefix".  Something like that.  "FUTURE is needed for
> prefix support"?

ok!

>
>> +/* Return whether we should generate PC-relative code for *FN.  */
>> +bool
>> +rs6000_pcrel_p (struct function *fn)
>> +{
>> +  if (DEFAULT_ABI != ABI_ELFv2)
>> +    return false;
>> +
>> +  /* Optimize usual case.  */
>> +  if (fn == cfun)
> Maybe have a separate (helper) function for this?  Defined in the header,
> if performance matters.

As we discussed, I'll defer this until after I finish the refactoring of
offline patches.

Thanks!
Bill
>
> Looks good.  Okay for trunk.  Thanks!
>
>
> Segher
>



More information about the Gcc-patches mailing list