These patches were previously posted in March as a RFC, and I would like to check them into the trunk. These patches make the mode_supports* functions use similar names for the functions that return if a mode supports D-FORM, DS-FORM, and/or DQ-FORM instructions, and add the ability to ask whether a particular reload register class supports a particular D*-form instruction.
This is patch #4 of 4. I have done a bootstrap with patches 1-4 and did a make check comparison on a little endian power8 system, and there were no regressions. Can I check it in? 2018-05-03 Michael Meissner <meiss...@linux.vnet.ibm.com> * config/rs6000/rs6000.c (mode_supports_pre_incdec_p): Add additional argument to specify the reload register class to use, defaulting to RELOAD_REG_ANY. (mode_supports_pre_modify_p): Likewise. (mode_supports_dq_form): Likewise. -- 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
Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 259878) +++ gcc/config/rs6000/rs6000.c (revision 259879) @@ -537,20 +537,22 @@ struct rs6000_reg_addr { static struct rs6000_reg_addr reg_addr[NUM_MACHINE_MODES]; -/* Helper function to say whether a mode supports PRE_INC or PRE_DEC. */ +/* Helper function to say whether a mode supports PRE_INC or PRE_DEC in a given + reload register class or if some reload register class supports it. */ static inline bool -mode_supports_pre_incdec_p (machine_mode mode) +mode_supports_pre_incdec_p (machine_mode mode, + enum rs6000_reload_reg_type rt = RELOAD_REG_ANY) { - return ((reg_addr[mode].addr_mask[RELOAD_REG_ANY] & RELOAD_REG_PRE_INCDEC) - != 0); + return ((reg_addr[mode].addr_mask[rt] & RELOAD_REG_PRE_INCDEC) != 0); } -/* Helper function to say whether a mode supports PRE_MODIFY. */ +/* Helper function to say whether a mode supports PRE_MODIFY in a given + reload register class or if some reload register class supports it.. */ static inline bool -mode_supports_pre_modify_p (machine_mode mode) +mode_supports_pre_modify_p (machine_mode mode, + enum rs6000_reload_reg_type rt = RELOAD_REG_ANY) { - return ((reg_addr[mode].addr_mask[RELOAD_REG_ANY] & RELOAD_REG_PRE_MODIFY) - != 0); + return ((reg_addr[mode].addr_mask[rt] & RELOAD_REG_PRE_MODIFY) != 0); } /* Return true if we have D-form addressing (register+offset) in either a @@ -563,14 +565,14 @@ mode_supports_d_form (machine_mode mode, return ((reg_addr[mode].addr_mask[rt] & RELOAD_REG_OFFSET) != 0); } -/* Return true if we have D-form addressing in VSX registers. This addressing - is more limited than normal d-form addressing in that the offset must be - aligned on a 16-byte boundary. */ +/* Return true if we have DQ-form addressing in a given reload register class + or if some reload register class supports it. DQ-form addressing must have + the bottom 4 bits set to 0. */ static inline bool -mode_supports_dq_form (machine_mode mode) +mode_supports_dq_form (machine_mode mode, + enum rs6000_reload_reg_type rt = RELOAD_REG_ANY) { - return ((reg_addr[mode].addr_mask[RELOAD_REG_ANY] & RELOAD_REG_QUAD_OFFSET) - != 0); + return ((reg_addr[mode].addr_mask[rt] & RELOAD_REG_QUAD_OFFSET) != 0); } /* Given that there exists at least one variable that is set (produced)