+2005-11-28 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * config/bfin/bfin.c (bfin_secondary_reload): Renamed from
+ secondary_input_reload_class, made static. Adapt to new
+ infrastructure.
+ (secondary_output_reload_class): Delete.
+ (TARGET_SECONDARY_RELOAD): New macro.
+ * config/bfin/bfin.h (SECONDARY_INPUT_RELOAD_CLASS,
+ SECONDARY_OUTPUT_RELOAD_CLASS): Delete.
+
2005-11-28 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21166
CLASS requires an extra scratch register. Return the class needed for the
scratch register. */
-enum reg_class
-secondary_input_reload_class (enum reg_class class, enum machine_mode mode,
- rtx x)
+static enum reg_class
+bfin_secondary_reload (bool in_p, rtx x, enum reg_class class,
+ enum machine_mode mode, secondary_reload_info *sri)
{
/* If we have HImode or QImode, we can only use DREGS as secondary registers;
in most other cases we can also use PREGS. */
return NO_REGS;
/* If destination is a DREG, we can do this without a scratch register
if the constant is valid for an add instruction. */
- if (class == DREGS || class == DPREGS)
- return large_constant_p ? PREGS : NO_REGS;
+ if ((class == DREGS || class == DPREGS)
+ && ! large_constant_p)
+ return NO_REGS;
/* Reloading to anything other than a DREG? Use a PREG scratch
register. */
- return PREGS;
+ sri->icode = CODE_FOR_reload_insi;
+ return NO_REGS;
}
/* Data can usually be moved freely between registers of most classes.
return default_class;
return NO_REGS;
}
-
-/* Like secondary_input_reload_class; and all we do is call that function. */
-
-enum reg_class
-secondary_output_reload_class (enum reg_class class, enum machine_mode mode,
- rtx x)
-{
- return secondary_input_reload_class (class, mode, x);
-}
\f
/* Implement TARGET_HANDLE_OPTION. */
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+#undef TARGET_SECONDARY_RELOAD
+#define TARGET_SECONDARY_RELOAD bfin_secondary_reload
+
struct gcc_target targetm = TARGET_INITIALIZER;
perhaps another, smaller class. */
#define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)
-#define SECONDARY_OUTPUT_RELOAD_CLASS(class,mode,x) \
- secondary_output_reload_class(class,mode,x)
-#define SECONDARY_INPUT_RELOAD_CLASS(class,mode,x) \
- secondary_input_reload_class(class,mode,x)
-
/* Function Calling Conventions. */
/* The type of the current function; normal functions are of type