+2005-12-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/mt/mt.md (decrement_and_branch_until_zero): Add another
+ scratch. Correct its reload split. Adjust its peephole.
+ (doloop_end): Add additional scratch.
+ (nop): Use 'nop'.
+ * config/mt/mt.c (MT_INT_ARG_FIRST): Remove.
+ (mt_asm_output_opcode, mt_print_operand): Use 'nop'.
+ (mt_function_arg_slotno): Use FIRST_ARG_REGNUM.
+ (mt_builtin_saveregs): Replace with ...
+ (mt_setup_incoming_varargs): ... here. Save just the varadic
+ args.
+ (mt_va_start): Remove.
+ (mt_reorg_hazard): Ignore USE insns. Don't call set_noop_p.
+ (mt_machine_reorg): Split all insns here.
+ (TARGET_SETUP_INCOMING_VARARGS): Override.
+ * config/mt/mt.h (TARGET_CPU_CPP_BUILTINS): Define __mt__ only.
+ Set to CPU type.
+ (EXPAND_BUILTIN_VA_START): Remove.
+
2005-12-17 Kenneth Zadeck <zadeck@naturalbridge.com>
* flow.c (update_life_info, count_or_remove_death_notes): Fixed
2005-12-13 Nathan Sidwell <nathan@codesourcery.com>
- * sim/common/sim-signal.c (sim_signal_to_target): Add missing ':'.
- * sim/common/sim-signal.h (sim_signal_to_target): Return an int.
-
* config/mt/t-mt (crti.o, crtn.o): Add multilib options.
(EXTRA_MULTILIB_PARTS): Define.
2005-12-09 Aldy Hernandez <aldyh@redhat.com>
- * config/ms1/t-ms1 (MULTILIB_OPTIONS): Define.
- (MULTILIB_DIRNAMES): Define.
+ * config/ms1/t-ms1 (MULTILIB_OPTIONS): Define.
+ (MULTILIB_DIRNAMES): Define.
2005-12-09 Ulrich Weigand <uweigand@de.ibm.com>
/* Link register mask. */
#define LINK_MASK (1 << (GPR_LINK))
-/* First GPR. */
-#define MT_INT_ARG_FIRST 1
-
/* Given a SIZE in bytes, advance to the next word. */
#define ROUND_ADVANCE(SIZE) (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
while (mt_nops_required)
{
- fprintf (f, "or r0, r0, r0\n\t");
+ fprintf (f, "nop\n\t");
-- mt_nops_required;
}
case '#':
/* Output a nop if there's nothing for the delay slot. */
if (dbr_sequence_length () == 0)
- fputs ("\n\tor r0, r0, r0", file);
+ fputs ("\n\tnop", file);
return;
case 'H':
int incoming_p ATTRIBUTE_UNUSED,
int * pregno)
{
- int regbase = MT_INT_ARG_FIRST;
+ int regbase = FIRST_ARG_REGNUM;
int slotno = * cum;
if (mode == VOIDmode || targetm.calls.must_pass_in_stack (mode, type))
to determine if stdarg or varargs is used and return the address of the
first unnamed parameter. */
-static rtx
-mt_builtin_saveregs (void)
+static void
+mt_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED,
+ int *pretend_size, int no_rtl)
{
- int first_reg = 0;
- rtx address;
int regno;
-
- for (regno = first_reg; regno < MT_NUM_ARG_REGS; regno ++)
- emit_move_insn
- (gen_rtx_MEM (word_mode,
- gen_rtx_PLUS (Pmode,
- gen_rtx_REG (SImode, ARG_POINTER_REGNUM),
- GEN_INT (UNITS_PER_WORD * regno))),
- gen_rtx_REG (word_mode,
- MT_INT_ARG_FIRST + regno));
-
- address = gen_rtx_PLUS (Pmode,
- gen_rtx_REG (SImode, ARG_POINTER_REGNUM),
- GEN_INT (UNITS_PER_WORD * first_reg));
- return address;
-}
-
-/* Implement `va_start'. */
-
-void
-mt_va_start (tree valist, rtx nextarg)
-{
- mt_builtin_saveregs ();
- std_expand_builtin_va_start (valist, nextarg);
+ int regs = MT_NUM_ARG_REGS - *cum;
+
+ *pretend_size = regs < 0 ? 0 : GET_MODE_SIZE (SImode) * regs;
+
+ if (no_rtl)
+ return;
+
+ for (regno = *cum; regno < MT_NUM_ARG_REGS; regno++)
+ {
+ rtx reg = gen_rtx_REG (SImode, FIRST_ARG_REGNUM + regno);
+ rtx slot = gen_rtx_PLUS (Pmode,
+ gen_rtx_REG (SImode, ARG_POINTER_REGNUM),
+ GEN_INT (UNITS_PER_WORD * regno));
+
+ emit_move_insn (gen_rtx_MEM (SImode, slot), reg);
+ }
}
/* Returns the number of bytes offset between the frame pointer and the stack
gcc_assert (INSN_P (insn) && !INSN_DELETED_P (insn));
for (next = NEXT_INSN (insn);
- next && !INSN_P (next);
+ next;
next = NEXT_INSN (next))
- continue;
+ {
+ if (!INSN_P (next))
+ continue;
+ if (GET_CODE (PATTERN (next)) != USE)
+ break;
+ }
jmp = insn;
if (GET_CODE (PATTERN (insn)) == SEQUENCE)
}
continue;
}
- if (!INSN_P (prev))
+ if (!INSN_P (prev) || GET_CODE (PATTERN (prev)) == USE)
continue;
if (GET_CODE (PATTERN (prev)) == SEQUENCE)
}
if (INSN_CODE (prev) >= 0)
- {
- rtx set = single_set (prev);
-
- /* A noop set will get deleted in a later split pass,
- so we can't count on it for hazard avoidance. */
- if (!set || !set_noop_p (set))
- count--;
- }
+ count--;
}
if (rescan)
dbr_schedule (get_insns (), dump_file);
if (TARGET_MS2)
- mt_reorg_hazard ();
+ {
+ /* Force all instructions to be split into their final form. */
+ split_all_insns_noflow ();
+ mt_reorg_hazard ();
+ }
}
\f
/* Initialize the GCC target structure. */
#define TARGET_MUST_PASS_IN_STACK mt_pass_in_stack
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES mt_arg_partial_bytes
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS mt_setup_incoming_varargs
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mt_machine_reorg
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int -1)))
- (clobber (match_scratch:SI 2 "=X,&r"))]
+ (clobber (match_scratch:SI 2 "=X,&r"))
+ (clobber (match_scratch:SI 3 "=X,&r"))]
"TARGET_MS1_16_003 || TARGET_MS2"
"@
dbnz\t%0, %l1%#
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int -1)))
- (clobber (match_scratch:SI 2 ""))]
+ (clobber (match_scratch:SI 2 ""))
+ (clobber (match_scratch:SI 3 ""))]
"TARGET_MS1_16_003 || TARGET_MS2"
[(set (match_dup 2) (match_dup 0))
- (set (match_dup 2) (plus:SI (match_dup 2) (const_int -1)))
- (set (match_dup 0) (match_dup 2))
+ (set (match_dup 3) (plus:SI (match_dup 2) (const_int -1)))
+ (set (match_dup 0) (match_dup 3))
(set (pc)
(if_then_else
(ne (match_dup 2)
(pc)))
(set (match_dup 0)
(plus:SI (match_dup 0) (const_int -1)))
+ (clobber (reg:SI 0))
(clobber (reg:SI 0))])]
"")
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int -1)))
- (clobber (match_scratch:SI 5 ""))])]
+ (clobber (match_scratch:SI 5 ""))
+ (clobber (match_scratch:SI 6 ""))])]
"TARGET_MS1_16_003 || TARGET_MS2"
{mt_add_loop ();})
\f
(define_insn "nop"
[(const_int 0)]
""
- "or r0,r0,r0"
+ "nop"
[(set_attr "length" "4")
(set_attr "type" "arith")])