[PATCH] PowerPC address support clean, patch 3 of 4
Segher Boessenkool
segher@kernel.crashing.org
Wed May 9 23:34:00 GMT 2018
On Thu, May 03, 2018 at 01:22:10PM -0400, Michael Meissner wrote:
> 2018-05-03 Michael Meissner <meissner@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).
Overloads are nice if they make things *easier* for the reader, not harder.
Same as with all other syntactic sugar.
Segher
More information about the Gcc-patches
mailing list