]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/config/lm32/lm32.c
Turn HARD_REGNO_MODE_OK into a target hook
[thirdparty/gcc.git] / gcc / config / lm32 / lm32.c
index 214cc0ac5fde6d18056188e40db23495c0acb217..536944fe2f7db4c95d98f8e3db05cf4896551025 100644 (file)
@@ -77,6 +77,7 @@ static rtx lm32_function_arg (cumulative_args_t cum,
 static void lm32_function_arg_advance (cumulative_args_t cum,
                                       machine_mode mode,
                                       const_tree type, bool named);
+static bool lm32_hard_regno_mode_ok (unsigned int, machine_mode);
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE lm32_option_override
@@ -106,6 +107,8 @@ static void lm32_function_arg_advance (cumulative_args_t cum,
 #define TARGET_LRA_P hook_bool_void_false
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P lm32_legitimate_address_p
+#undef TARGET_HARD_REGNO_MODE_OK
+#define TARGET_HARD_REGNO_MODE_OK lm32_hard_regno_mode_ok
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
@@ -1221,3 +1224,11 @@ lm32_move_ok (machine_mode mode, rtx operands[2]) {
     return register_or_zero_operand (operands[1], mode);
   return true;
 }
+
+/* Implement TARGET_HARD_REGNO_MODE_OK.  */
+
+static bool
+lm32_hard_regno_mode_ok (unsigned int regno, machine_mode)
+{
+  return G_REG_P (regno);
+}