+2014-05-13 Ian Bolton <ian.bolton@arm.com>
+
+ * config/aarch64/aarch64-protos.h
+ (aarch64_hard_regno_caller_save_mode): New prototype.
+ * config/aarch64/aarch64.c (aarch64_hard_regno_caller_save_mode):
+ New function.
+ * config/aarch64/aarch64.h (HARD_REGNO_CALLER_SAVE_MODE): New macro.
+
2014-05-13 Christian Bruel <christian.bruel@st.com>
* target.def (mode_switching): New hook vector.
enum aarch64_symbol_type aarch64_classify_tls_symbol (rtx);
enum reg_class aarch64_regno_regclass (unsigned);
int aarch64_asm_preferred_eh_data_format (int, int);
+enum machine_mode aarch64_hard_regno_caller_save_mode (unsigned, unsigned,
+ enum machine_mode);
int aarch64_hard_regno_mode_ok (unsigned, enum machine_mode);
int aarch64_hard_regno_nregs (unsigned, enum machine_mode);
int aarch64_simd_attr_length_move (rtx);
return 0;
}
+/* Implement HARD_REGNO_CALLER_SAVE_MODE. */
+enum machine_mode
+aarch64_hard_regno_caller_save_mode (unsigned regno, unsigned nregs,
+ enum machine_mode mode)
+{
+ /* Handle modes that fit within single registers. */
+ if (nregs == 1 && GET_MODE_SIZE (mode) <= 16)
+ {
+ if (GET_MODE_SIZE (mode) >= 4)
+ return mode;
+ else
+ return SImode;
+ }
+ /* Fall back to generic for multi-reg and very large modes. */
+ else
+ return choose_hard_reg_mode (regno, nregs, false);
+}
+
/* Return true if calls to DECL should be treated as
long-calls (ie called via a register). */
static bool
#define SHIFT_COUNT_TRUNCATED !TARGET_SIMD
+/* Choose appropriate mode for caller saves, so we do the minimum
+ required size of load/store. */
+#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
+ aarch64_hard_regno_caller_save_mode ((REGNO), (NREGS), (MODE))
+
/* Callee only saves lower 64-bits of a 128-bit register. Tell the
compiler the callee clobbers the top 64-bits when restoring the
bottom 64-bits. */