On Wed, May 09, 2018 at 06:14:27PM -0500, Segher Boessenkool wrote: > On Thu, May 03, 2018 at 01:22:10PM -0400, Michael Meissner wrote: > > 2018-05-03 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. Change all > > callers to pass in the RELOAD_REG_VMX class explicitly. > > (rs6000_secondary_reload): Likewise. > > (rs6000_preferred_reload_class): Likewise. > > (rs6000_secondary_reload_class): Likewise. > > Please don't say "likewise" unless the change is actually similar. > > > -/* Return true if we have D-form addressing in altivec registers. */ > > +/* Return true if we have D-form addressing (register+offset) in either a > > + specific reload register class or whether some reload register class > > + supports d-form addressing. */ > > static inline bool > > -mode_supports_vmx_dform (machine_mode mode) > > +mode_supports_d_form (machine_mode mode, > > + enum rs6000_reload_reg_type rt = RELOAD_REG_ANY) > > { > > - return ((reg_addr[mode].addr_mask[RELOAD_REG_VMX] & RELOAD_REG_OFFSET) > > != 0); > > + return ((reg_addr[mode].addr_mask[rt] & RELOAD_REG_OFFSET) != 0); > > } > > Will this overload help anything? It does not look that way, all current > callers use a different argument (and all the same).
All current callers just use the ANY option (except for these calls). However in the future, I'm planning on calling these functions with the specific reload register class (hence the change). > Overloads are nice if they make things *easier* for the reader, not harder. > Same as with all other syntactic sugar. -- 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