]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/config/arm/arm.c
Turn HARD_REGNO_MODE_OK into a target hook
[thirdparty/gcc.git] / gcc / config / arm / arm.c
index b27853464a55dcf22339298da30431aba900180e..3c6c56ccdb5ae5f50ec90b0a1d02bfe40385ead2 100644 (file)
@@ -313,6 +313,7 @@ static unsigned int arm_elf_section_type_flags (tree decl, const char *name,
                                                int reloc);
 static void arm_expand_divmod_libfunc (rtx, machine_mode, rtx, rtx, rtx *, rtx *);
 static opt_scalar_float_mode arm_floatn_mode (int, bool);
+static bool arm_hard_regno_mode_ok (unsigned int, machine_mode);
 \f
 /* Table of machine attributes.  */
 static const struct attribute_spec arm_attribute_table[] =
@@ -780,6 +781,8 @@ static const struct attribute_spec arm_attribute_table[] =
 #undef TARGET_FIXED_CONDITION_CODE_REGS
 #define TARGET_FIXED_CONDITION_CODE_REGS arm_fixed_condition_code_regs
 
+#undef TARGET_HARD_REGNO_MODE_OK
+#define TARGET_HARD_REGNO_MODE_OK arm_hard_regno_mode_ok
 \f
 /* Obstack for minipool constant handling.  */
 static struct obstack minipool_obstack;
@@ -23344,9 +23347,8 @@ thumb2_asm_output_opcode (FILE * stream)
     }
 }
 
-/* Returns true if REGNO is a valid register
-   for holding a quantity of type MODE.  */
-int
+/* Implement TARGET_HARD_REGNO_MODE_OK.  */
+static bool
 arm_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
 {
   if (GET_MODE_CLASS (mode) == MODE_CC)
@@ -23390,7 +23392,7 @@ arm_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
               || (mode == CImode && NEON_REGNO_OK_FOR_NREGS (regno, 6))
               || (mode == XImode && NEON_REGNO_OK_FOR_NREGS (regno, 8));
 
-      return FALSE;
+      return false;
     }
 
   if (TARGET_REALLY_IWMMXT)
@@ -23409,10 +23411,10 @@ arm_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
   if (regno <= LAST_ARM_REGNUM)
     {
       if (ARM_NUM_REGS (mode) > 4)
-         return FALSE;
+       return false;
 
       if (TARGET_THUMB2)
-       return TRUE;
+       return true;
 
       return !(TARGET_LDRD && GET_MODE_SIZE (mode) > 4 && (regno & 1) != 0);
     }
@@ -23422,7 +23424,7 @@ arm_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
     /* We only allow integers in the fake hard registers.  */
     return GET_MODE_CLASS (mode) == MODE_INT;
 
-  return FALSE;
+  return false;
 }
 
 /* Implement MODES_TIEABLE_P.  */