diff options
Diffstat (limited to 'gcc/config/m32r/m32r.c')
-rw-r--r-- | gcc/config/m32r/m32r.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 44736ed..9b7cb5f 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -103,6 +103,7 @@ static void m32r_trampoline_init (rtx, tree, rtx); static bool m32r_legitimate_constant_p (machine_mode, rtx); static bool m32r_attribute_identifier (const_tree); static bool m32r_hard_regno_mode_ok (unsigned int, machine_mode); +static bool m32r_modes_tieable_p (machine_mode, machine_mode); /* M32R specific attributes. */ @@ -213,6 +214,9 @@ static const struct attribute_spec m32r_attribute_table[] = #undef TARGET_HARD_REGNO_MODE_OK #define TARGET_HARD_REGNO_MODE_OK m32r_hard_regno_mode_ok +#undef TARGET_MODES_TIEABLE_P +#define TARGET_MODES_TIEABLE_P m32r_modes_tieable_p + struct gcc_target targetm = TARGET_INITIALIZER; /* Called by m32r_option_override to initialize various things. */ @@ -2759,6 +2763,17 @@ m32r_hard_regno_mode_ok (unsigned int regno, machine_mode mode) return (m32r_hard_regno_modes[regno] & m32r_mode_class[mode]) != 0; } +/* Implement TARGET_MODES_TIEABLE_P. Tie QI/HI/SI modes together. */ + +static bool +m32r_modes_tieable_p (machine_mode mode1, machine_mode mode2) +{ + return (GET_MODE_CLASS (mode1) == MODE_INT + && GET_MODE_CLASS (mode2) == MODE_INT + && GET_MODE_SIZE (mode1) <= UNITS_PER_WORD + && GET_MODE_SIZE (mode2) <= UNITS_PER_WORD); +} + /* Return true if using NEW_REG in place of OLD_REG is ok. */ int |