+2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/c6x/c6x-protos.h (c6x_set_return_address): Declare.
+ * config/c6x/c6x.h (REGNO_REG_CLASS): Move implementation to
+ * config/c6x/c6x.c (c6x_regno_reg_class): ...this new function.
+
2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
* rtl.h (get_call_rtx_from): Take a const rtx_insn * instead of an rtx.
extern rtx c6x_return_addr_rtx (int);
extern void c6x_set_return_address (rtx, rtx);
+
+enum reg_class c6x_regno_reg_class (int);
#endif
extern void c6x_override_options (void);
&& GET_MODE_SIZE (mode2) <= UNITS_PER_WORD));
}
+/* Implement REGNO_REG_CLASS. */
+
+enum reg_class
+c6x_regno_reg_class (int reg)
+{
+ if (reg >= REG_A1 && reg <= REG_A2)
+ return PREDICATE_A_REGS;
+
+ if (reg == REG_A0 && TARGET_INSNS_64)
+ return PREDICATE_A_REGS;
+
+ if (reg >= REG_B0 && reg <= REG_B2)
+ return PREDICATE_B_REGS;
+
+ if (A_REGNO_P (reg))
+ return NONPREDICATE_A_REGS;
+
+ if (call_used_regs[reg])
+ return CALL_USED_B_REGS;
+
+ return B_REGS;
+}
\f
/* Target Structure. */
#define CROSS_OPERANDS(X0,X1) \
(A_REG_P (X0) == A_REG_P (X1) ? CROSS_N : CROSS_Y)
-#define REGNO_REG_CLASS(reg) \
- ((reg) >= REG_A1 && (reg) <= REG_A2 ? PREDICATE_A_REGS \
- : (reg) == REG_A0 && TARGET_INSNS_64 ? PREDICATE_A_REGS \
- : (reg) >= REG_B0 && (reg) <= REG_B2 ? PREDICATE_B_REGS \
- : A_REGNO_P (reg) ? NONPREDICATE_A_REGS \
- : call_used_regs[reg] ? CALL_USED_B_REGS : B_REGS)
+#define REGNO_REG_CLASS(reg) c6x_regno_reg_class (reg)
#define BASE_REG_CLASS ALL_REGS
#define INDEX_REG_CLASS ALL_REGS