On Fri, Jan 31, 2020 at 07:12:53PM -0600, Segher Boessenkool wrote:
> Hi!
> 
> On Thu, Jan 09, 2020 at 07:40:08PM -0500, Michael Meissner wrote:
> >     * config/rs6000/linux64.h (PREFIXED_ADDR_SUPPORTED_BY_OS): Set to
> >     1 to enable prefixed addressing if -mcpu=future.
> >     (PCREL_SUPPORTED_BY_OS): Set to 1 to enable PC-relative addressing
> >     if -mcpu=future.
> >     * config/rs6000/rs6000-cpus.h (ISA_FUTURE_MASKS_SERVER): Do not
> >     enable -mprefixed-addr or -mpcrel by default.
> 
> I understand why this is needed for pcrel (or useful at least), but why
> for prefixed addressing in general as well?  What OS support is needed
> for that?
> 
> Put another way, is this just carefulness, or do you run into actual
> problems without it?

Just caution.  I can just do the PCREL.

> > +/* Enable support for pc-relative and numeric prefixed addressing on the
> > +   'future' system.  */
> > +#undef  PREFIXED_ADDR_SUPPORTED_BY_OS
> > +#define PREFIXED_ADDR_SUPPORTED_BY_OS      1
> > +
> > +#undef  PCREL_SUPPORTED_BY_OS
> > +#define PCREL_SUPPORTED_BY_OS              1
> 
> "Numeric prefixed addressing"?  What's that?  Just "and other prefixed
> addressing", maybe?

Using a prefixed address with a large offset, or using a small offset because
the traditional instruction is a DS/DQ instruction and the bottom 2/4 bits are
non-zero.

> (Is it useful to have those two separate at all, btw?  Now, that is while
> we are still developing the code, but also in the future?)
> 
> > +/* Addressing related flags on a future processor.  These are options that 
> > need
> > +   to be cleared if the target OS is not capable of supporting prefixed
> > +   addressing at all (such as 32-bit mode or if the object file format is 
> > not
> > +   ELF v2).  */
> 
> Ah.  If we are missing the needed relocations (or other as/ld support).
> So it is not about OS really, missing toolchain support instead?

It also plays into the dynamic loader of the system.  If the dynamic loader
doesn't support the new relocations, you can't do PCREL.

> 
> > +      /* Only ELFv2 currently supports prefixed/pcrel addressing.  */
> > +      else if (rs6000_current_abi != ABI_ELFv2)
> > +   {
> > +     if (TARGET_PCREL && explicit_pcrel)
> > +       error ("%qs requires %qs", "-mpcrel", "-mabi=elfv2");
> > +
> > +     else if (TARGET_PREFIXED_ADDR && explicit_prefixed)
> > +       error ("%qs requires %qs", "-mprefixed-addr", "-mabi=elfv2");
> 
> It would be good if the error messages also said "currently" somehow (it
> is not an actual limitation, it's just a matter of code).  "Is only
> supported with -mabi=elfv2", perhaps?

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to