+#include "gen_sparc_regalloc_if.h"
+#include "bitfiddle.h"
+
+static const unsigned ignore_regs[] = {
+ REG_G0,
+ /* used in case an address offset does not fit into an immediate: */
+ REG_G4,
+ /* reserved for SPARC ABI: */
+ REG_G5,
+ REG_G6,
+ REG_G7,
+
+ REG_SP,
+ REG_O7,
+ REG_FRAME_POINTER,
+ REG_I7,
+
+ REG_FPFLAGS,
+ REG_FLAGS,
+ REG_Y,
+};
+
+static const arch_register_t* const param_regs[] = {
+ &sparc_registers[REG_I0],
+ &sparc_registers[REG_I1],
+ &sparc_registers[REG_I2],
+ &sparc_registers[REG_I3],
+ &sparc_registers[REG_I4],
+ &sparc_registers[REG_I5],
+};
+COMPILETIME_ASSERT(ARRAY_SIZE(param_regs) == SPARC_N_PARAM_REGS, sparcparamregs)
+
+static const arch_register_t* const float_result_regs[] = {
+ &sparc_registers[REG_F0],
+ &sparc_registers[REG_F1],
+ &sparc_registers[REG_F2],
+ &sparc_registers[REG_F3],
+ &sparc_registers[REG_F4],
+ &sparc_registers[REG_F5],
+ &sparc_registers[REG_F6],
+ &sparc_registers[REG_F7],
+};
+static arch_register_req_t float_result_reqs_double[8];
+static arch_register_req_t float_result_reqs_quad[8];
+
+static const unsigned caller_saves[] = {
+ REG_G1,
+ REG_G2,
+ REG_G3,
+ REG_O0,
+ REG_O1,
+ REG_O2,
+ REG_O3,
+ REG_O4,
+ REG_O5,
+ REG_F0,
+ REG_F1,
+ REG_F2,
+ REG_F3,
+ REG_F4,
+ REG_F5,
+ REG_F6,
+ REG_F7,
+ REG_F8,
+ REG_F9,
+ REG_F10,
+ REG_F11,
+ REG_F12,
+ REG_F13,
+ REG_F14,
+ REG_F15,
+ REG_F16,
+ REG_F17,
+ REG_F18,
+ REG_F19,
+ REG_F20,
+ REG_F21,
+ REG_F22,
+ REG_F23,
+ REG_F24,
+ REG_F25,
+ REG_F26,
+ REG_F27,
+ REG_F28,
+ REG_F29,
+ REG_F30,
+ REG_F31,
+};
+static unsigned default_caller_saves[BITSET_SIZE_ELEMS(N_SPARC_REGISTERS)];
+
+static const unsigned returns_twice_saved[] = {
+ REG_SP,
+ REG_FRAME_POINTER,
+ REG_I7
+};
+static unsigned default_returns_twice_saves[BITSET_SIZE_ELEMS(N_SPARC_REGISTERS)];