+2002-03-16 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_override_options): Don't use
+ soft registers by default for 68HC12.
+ (m68hc11_conditional_register_usage): Don't use Z register for 68HC12
+ when compiling with -fomit-frame-pointer.
+ (expand_prologue): Use push/pop to allocate 4-bytes of locals on 68HC12.
+ (expand_epilogue): Likewise.
+ (m68hc11_gen_rotate): Use exg when rotating by 8.
+
2002-03-16 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11-protos.h (ix_reg): Declare.
if (TARGET_DEFAULT != MASK_M6811)
target_flags &= ~TARGET_DEFAULT;
+ if (!TARGET_M6812)
+ target_flags &= ~TARGET_AUTO_INC_DEC;
m68hc11_cost = &m6811_cost;
m68hc11_min_offset = 0;
m68hc11_max_offset = 256;
target_flags &= ~MASK_M6811;
target_flags |= MASK_NO_DIRECT_MODE;
if (m68hc11_soft_reg_count == 0)
- m68hc11_soft_reg_count = "2";
+ m68hc11_soft_reg_count = "0";
}
return 0;
}
fixed_regs[i] = 1;
call_used_regs[i] = 1;
}
+
+ /* For 68HC12, the Z register emulation is not necessary when the
+ frame pointer is not used. The frame pointer is eliminated and
+ replaced by the stack register (which is a BASE_REG_CLASS). */
+ if (TARGET_M6812 && flag_omit_frame_pointer && optimize)
+ {
+ fixed_regs[HARD_Z_REGNUM] = 1;
+ }
}
\f
emit_move_after_reload (stack_push_word, hard_frame_pointer_rtx, scratch);
/* Allocate local variables. */
- if (TARGET_M6812 && size >= 2)
+ if (TARGET_M6812 && (size > 4 || size == 3))
{
emit_insn (gen_addhi3 (stack_pointer_rtx,
stack_pointer_rtx, GEN_INT (-size)));
}
/* de-allocate auto variables */
- if (TARGET_M6812 && size >= 2)
+ if (TARGET_M6812 && (size > 4 || size == 3))
{
emit_insn (gen_addhi3 (stack_pointer_rtx,
stack_pointer_rtx, GEN_INT (size)));
/* Rotate by 8-bits if the shift is within [5..11]. */
if (val >= 5 && val <= 11)
{
- output_asm_insn ("psha", operands);
- output_asm_insn ("tba", operands);
- output_asm_insn ("pulb", operands);
+ if (TARGET_M6812)
+ output_asm_insn ("exg\ta,b", operands);
+ else
+ {
+ output_asm_insn ("psha", operands);
+ output_asm_insn ("tba", operands);
+ output_asm_insn ("pulb", operands);
+ }
val -= 8;
}