On Thu, Mar 22, 2018 at 10:03:55AM -0500, Segher Boessenkool wrote:
> Hi!
> 
> On Thu, Mar 22, 2018 at 08:16:36AM -0400, Michael Meissner wrote:
> > This match renames the d-form mode support function and makes it more 
> > general.
> > It was originally written to test whether we have the ISA 3.0 new D*-form
> > instruction, but I believe in the future, I will want to use it also for GPR
> > and tradiational floating point registers.
> > 
> > I have built bootstrap compilers with the first 4 patches including this 
> > patch
> > on both big and little endian power8 systems.  There were no regressions.
> > 
> > 2018-03-21  Michael Meissner  <meiss...@linux.vnet.ibm.com>
> > 
> >     * config/rs6000/rs6000.c (mode_supports_d_form): Rename
> >     mode_supports_vmx_dform to mode_supports_d_form.  Add an optional
> >     argument to say which reload register class to use.  Chagne all
> 
> (typo, "change").

Ok.

> >     callers to pass in the RELOAD_REG_VMX class explicitly.
> >     (rs6000_secondary_reload): Likewise.
> >     (rs6000_preferred_reload_class): Likewise.
> >     (rs6000_secondary_reload_class): Likewise.
> 
> So it is called "mode_supports_d_form" but it actually returns true for
> *any* offset form?

Yes, the intention is to say whether some form of offset is available.  Other
parts need to know whether the offset is D-form, DS-form, DQ-form, and perhaps
other forms in the future.

> > +mode_supports_d_form (machine_mode mode,
> > +                 enum rs6000_reload_reg_type rt = RELOAD_REG_ANY)
> 
> Does the default argument make the interface simpler, or more complex?

The intention is for things like go if legitimate address, where you don't have
context of which register to use, you will use the default second argument.

However, when you are in the middle of secondary reload and friends, and you
are wanting to know what a specific reload register class (GPR, FPR, VMX)
constraints are, you will add the second argument.  It makes it easier to use
the function if you don't need to specify the second argument.  With the 79
character limit, the 2nd argument would often force a line break.

I'm trying to get rid of a lot of tests that say things like:

        if (gpr-register && (mode == DFmode || DImode || ...)) { }

and instead move the tests to reg_addr.  Of course right now, it is just 

For example for DFmode, if you are loading it into a GPR, it uses DS-form, if
you are loading it into a FPR, it uses normal 16-bit D-form, and if you don't
have the ISA 3.0 instruction set, the VMX register doesn't support an
offset load form at all.

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

Reply via email to