Commit 819f8bd7 by Nathan Sidwell

mt.md (decrement_and_branch_until_zero): Add another scratch.

	* 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.

From-SVN: r108787
parent 2803e997
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> 2005-12-17 Kenneth Zadeck <zadeck@naturalbridge.com>
* flow.c (update_life_info, count_or_remove_death_notes): Fixed * flow.c (update_life_info, count_or_remove_death_notes): Fixed
...@@ -906,9 +926,6 @@ ...@@ -906,9 +926,6 @@
2005-12-13 Nathan Sidwell <nathan@codesourcery.com> 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. * config/mt/t-mt (crti.o, crtn.o): Add multilib options.
(EXTRA_MULTILIB_PARTS): Define. (EXTRA_MULTILIB_PARTS): Define.
...@@ -1222,8 +1239,8 @@ ...@@ -1222,8 +1239,8 @@
2005-12-09 Aldy Hernandez <aldyh@redhat.com> 2005-12-09 Aldy Hernandez <aldyh@redhat.com>
* config/ms1/t-ms1 (MULTILIB_OPTIONS): Define. * config/ms1/t-ms1 (MULTILIB_OPTIONS): Define.
(MULTILIB_DIRNAMES): Define. (MULTILIB_DIRNAMES): Define.
2005-12-09 Ulrich Weigand <uweigand@de.ibm.com> 2005-12-09 Ulrich Weigand <uweigand@de.ibm.com>
......
...@@ -55,9 +55,6 @@ ...@@ -55,9 +55,6 @@
/* Link register mask. */ /* Link register mask. */
#define LINK_MASK (1 << (GPR_LINK)) #define LINK_MASK (1 << (GPR_LINK))
/* First GPR. */
#define MT_INT_ARG_FIRST 1
/* Given a SIZE in bytes, advance to the next word. */ /* Given a SIZE in bytes, advance to the next word. */
#define ROUND_ADVANCE(SIZE) (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) #define ROUND_ADVANCE(SIZE) (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
...@@ -122,7 +119,7 @@ mt_asm_output_opcode (FILE *f ATTRIBUTE_UNUSED, const char *ptr) ...@@ -122,7 +119,7 @@ mt_asm_output_opcode (FILE *f ATTRIBUTE_UNUSED, const char *ptr)
while (mt_nops_required) while (mt_nops_required)
{ {
fprintf (f, "or r0, r0, r0\n\t"); fprintf (f, "nop\n\t");
-- mt_nops_required; -- mt_nops_required;
} }
...@@ -421,7 +418,7 @@ mt_print_operand (FILE * file, rtx x, int code) ...@@ -421,7 +418,7 @@ mt_print_operand (FILE * file, rtx x, int code)
case '#': case '#':
/* Output a nop if there's nothing for the delay slot. */ /* Output a nop if there's nothing for the delay slot. */
if (dbr_sequence_length () == 0) if (dbr_sequence_length () == 0)
fputs ("\n\tor r0, r0, r0", file); fputs ("\n\tnop", file);
return; return;
case 'H': case 'H':
...@@ -538,7 +535,7 @@ mt_function_arg_slotno (const CUMULATIVE_ARGS * cum, ...@@ -538,7 +535,7 @@ mt_function_arg_slotno (const CUMULATIVE_ARGS * cum,
int incoming_p ATTRIBUTE_UNUSED, int incoming_p ATTRIBUTE_UNUSED,
int * pregno) int * pregno)
{ {
int regbase = MT_INT_ARG_FIRST; int regbase = FIRST_ARG_REGNUM;
int slotno = * cum; int slotno = * cum;
if (mode == VOIDmode || targetm.calls.must_pass_in_stack (mode, type)) if (mode == VOIDmode || targetm.calls.must_pass_in_stack (mode, type))
...@@ -827,35 +824,29 @@ mt_override_options (void) ...@@ -827,35 +824,29 @@ mt_override_options (void)
to determine if stdarg or varargs is used and return the address of the to determine if stdarg or varargs is used and return the address of the
first unnamed parameter. */ first unnamed parameter. */
static rtx static void
mt_builtin_saveregs (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; int regno;
int regs = MT_NUM_ARG_REGS - *cum;
for (regno = first_reg; regno < MT_NUM_ARG_REGS; regno ++)
emit_move_insn *pretend_size = regs < 0 ? 0 : GET_MODE_SIZE (SImode) * regs;
(gen_rtx_MEM (word_mode,
gen_rtx_PLUS (Pmode, if (no_rtl)
gen_rtx_REG (SImode, ARG_POINTER_REGNUM), return;
GEN_INT (UNITS_PER_WORD * regno))),
gen_rtx_REG (word_mode, for (regno = *cum; regno < MT_NUM_ARG_REGS; regno++)
MT_INT_ARG_FIRST + regno)); {
rtx reg = gen_rtx_REG (SImode, FIRST_ARG_REGNUM + regno);
address = gen_rtx_PLUS (Pmode, rtx slot = gen_rtx_PLUS (Pmode,
gen_rtx_REG (SImode, ARG_POINTER_REGNUM), gen_rtx_REG (SImode, ARG_POINTER_REGNUM),
GEN_INT (UNITS_PER_WORD * first_reg)); GEN_INT (UNITS_PER_WORD * regno));
return address;
} emit_move_insn (gen_rtx_MEM (SImode, slot), reg);
}
/* Implement `va_start'. */
void
mt_va_start (tree valist, rtx nextarg)
{
mt_builtin_saveregs ();
std_expand_builtin_va_start (valist, nextarg);
} }
/* Returns the number of bytes offset between the frame pointer and the stack /* Returns the number of bytes offset between the frame pointer and the stack
...@@ -2312,9 +2303,14 @@ mt_reorg_hazard (void) ...@@ -2312,9 +2303,14 @@ mt_reorg_hazard (void)
gcc_assert (INSN_P (insn) && !INSN_DELETED_P (insn)); gcc_assert (INSN_P (insn) && !INSN_DELETED_P (insn));
for (next = NEXT_INSN (insn); for (next = NEXT_INSN (insn);
next && !INSN_P (next); next;
next = NEXT_INSN (next)) next = NEXT_INSN (next))
continue; {
if (!INSN_P (next))
continue;
if (GET_CODE (PATTERN (next)) != USE)
break;
}
jmp = insn; jmp = insn;
if (GET_CODE (PATTERN (insn)) == SEQUENCE) if (GET_CODE (PATTERN (insn)) == SEQUENCE)
...@@ -2390,7 +2386,7 @@ mt_reorg_hazard (void) ...@@ -2390,7 +2386,7 @@ mt_reorg_hazard (void)
} }
continue; continue;
} }
if (!INSN_P (prev)) if (!INSN_P (prev) || GET_CODE (PATTERN (prev)) == USE)
continue; continue;
if (GET_CODE (PATTERN (prev)) == SEQUENCE) if (GET_CODE (PATTERN (prev)) == SEQUENCE)
...@@ -2421,14 +2417,7 @@ mt_reorg_hazard (void) ...@@ -2421,14 +2417,7 @@ mt_reorg_hazard (void)
} }
if (INSN_CODE (prev) >= 0) if (INSN_CODE (prev) >= 0)
{ count--;
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--;
}
} }
if (rescan) if (rescan)
...@@ -2470,7 +2459,11 @@ mt_machine_reorg (void) ...@@ -2470,7 +2459,11 @@ mt_machine_reorg (void)
dbr_schedule (get_insns (), dump_file); dbr_schedule (get_insns (), dump_file);
if (TARGET_MS2) if (TARGET_MS2)
mt_reorg_hazard (); {
/* Force all instructions to be split into their final form. */
split_all_insns_noflow ();
mt_reorg_hazard ();
}
} }
/* Initialize the GCC target structure. */ /* Initialize the GCC target structure. */
...@@ -2488,6 +2481,8 @@ const struct attribute_spec mt_attribute_table[]; ...@@ -2488,6 +2481,8 @@ const struct attribute_spec mt_attribute_table[];
#define TARGET_MUST_PASS_IN_STACK mt_pass_in_stack #define TARGET_MUST_PASS_IN_STACK mt_pass_in_stack
#undef TARGET_ARG_PARTIAL_BYTES #undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES mt_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 #undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mt_machine_reorg #define TARGET_MACHINE_DEPENDENT_REORG mt_machine_reorg
......
...@@ -79,7 +79,7 @@ march=ms2:exit-ms2.o%s; \ ...@@ -79,7 +79,7 @@ march=ms2:exit-ms2.o%s; \
#define TARGET_CPU_CPP_BUILTINS() \ #define TARGET_CPU_CPP_BUILTINS() \
do \ do \
{ \ { \
builtin_define_std ("mt"); \ builtin_define_with_int_value ("__mt__", mt_cpu); \
builtin_assert ("machine=mt"); \ builtin_assert ("machine=mt"); \
} \ } \
while (0) while (0)
...@@ -600,9 +600,6 @@ extern struct mt_frame_info current_frame_info; ...@@ -600,9 +600,6 @@ extern struct mt_frame_info current_frame_info;
#define FUNCTION_PROFILER(FILE, LABELNO) gcc_unreachable () #define FUNCTION_PROFILER(FILE, LABELNO) gcc_unreachable ()
#define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
mt_va_start (VALIST, NEXTARG)
/* Trampolines are not implemented. */ /* Trampolines are not implemented. */
#define TRAMPOLINE_SIZE 0 #define TRAMPOLINE_SIZE 0
......
...@@ -89,7 +89,8 @@ ...@@ -89,7 +89,8 @@
(set (match_dup 0) (set (match_dup 0)
(plus:SI (match_dup 0) (plus:SI (match_dup 0)
(const_int -1))) (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" "TARGET_MS1_16_003 || TARGET_MS2"
"@ "@
dbnz\t%0, %l1%# dbnz\t%0, %l1%#
...@@ -110,11 +111,12 @@ ...@@ -110,11 +111,12 @@
(set (match_dup 0) (set (match_dup 0)
(plus:SI (match_dup 0) (plus:SI (match_dup 0)
(const_int -1))) (const_int -1)))
(clobber (match_scratch:SI 2 ""))] (clobber (match_scratch:SI 2 ""))
(clobber (match_scratch:SI 3 ""))]
"TARGET_MS1_16_003 || TARGET_MS2" "TARGET_MS1_16_003 || TARGET_MS2"
[(set (match_dup 2) (match_dup 0)) [(set (match_dup 2) (match_dup 0))
(set (match_dup 2) (plus:SI (match_dup 2) (const_int -1))) (set (match_dup 3) (plus:SI (match_dup 2) (const_int -1)))
(set (match_dup 0) (match_dup 2)) (set (match_dup 0) (match_dup 3))
(set (pc) (set (pc)
(if_then_else (if_then_else
(ne (match_dup 2) (ne (match_dup 2)
...@@ -145,6 +147,7 @@ ...@@ -145,6 +147,7 @@
(pc))) (pc)))
(set (match_dup 0) (set (match_dup 0)
(plus:SI (match_dup 0) (const_int -1))) (plus:SI (match_dup 0) (const_int -1)))
(clobber (reg:SI 0))
(clobber (reg:SI 0))])] (clobber (reg:SI 0))])]
"") "")
...@@ -197,7 +200,8 @@ ...@@ -197,7 +200,8 @@
(set (match_dup 0) (set (match_dup 0)
(plus:SI (match_dup 0) (plus:SI (match_dup 0)
(const_int -1))) (const_int -1)))
(clobber (match_scratch:SI 5 ""))])] (clobber (match_scratch:SI 5 ""))
(clobber (match_scratch:SI 6 ""))])]
"TARGET_MS1_16_003 || TARGET_MS2" "TARGET_MS1_16_003 || TARGET_MS2"
{mt_add_loop ();}) {mt_add_loop ();})
...@@ -1436,7 +1440,7 @@ ...@@ -1436,7 +1440,7 @@
(define_insn "nop" (define_insn "nop"
[(const_int 0)] [(const_int 0)]
"" ""
"or r0,r0,r0" "nop"
[(set_attr "length" "4") [(set_attr "length" "4")
(set_attr "type" "arith")]) (set_attr "type" "arith")])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment