Commit 68ee6df6 by Kazu Hirata Committed by Kazu Hirata

h8300-protos.h: Add prototypes for the new functions defined below.

	* config/h8300/h8300-protos.h: Add prototypes for
	the new functions defined below.
	* config/h8300/h8300.c (TARGET_ASM_FUNCTION_PROLOGUE): Do not
	define.
	(dosize): Emit RTL instead of assembly code.
	(push): Likewise.
	(pop): Likewise.
	(h8300_output_function_prologue): Remove.
	(h8300_expand_prologue): New.
	(h8300_expand_epilogue): New.
	(h8300_output_function_epilogue): Do only the reset of
	pragma_saveall.
	* config/h8300/h8300.md (push_h8300): New.
	(push_h8300hs): Likewise.
	(pop_h8300): Likewise.
	(pop_h8300hs): Likewise.
	(*stm_h8300s_2): Change the name to stm_h8300s_2.
	(*stm_h8300s_3): Change the name to stm_h8300s_3.
	(*stm_h8300s_4): Change the name to stm_h8300s_4.
	(*ldm_h8300s_2): New.
	(*ldm_h8300s_3): Likewise.
	(*ldm_h8300s_4): Likewise.
	(return): Likewise.
	(*return_1): Likewise.
	(prologue): Likewise.
	(epilogue): Likewise.
	(monitor_prologue): Likewise.

From-SVN: r60882
parent 2094e97d
2003-01-04 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300-protos.h: Add prototypes for
the new functions defined below.
* config/h8300/h8300.c (TARGET_ASM_FUNCTION_PROLOGUE): Do not
define.
(dosize): Emit RTL instead of assembly code.
(push): Likewise.
(pop): Likewise.
(h8300_output_function_prologue): Remove.
(h8300_expand_prologue): New.
(h8300_expand_epilogue): New.
(h8300_output_function_epilogue): Do only the reset of
pragma_saveall.
* config/h8300/h8300.md (push_h8300): New.
(push_h8300hs): Likewise.
(pop_h8300): Likewise.
(pop_h8300hs): Likewise.
(*stm_h8300s_2): Change the name to stm_h8300s_2.
(*stm_h8300s_3): Change the name to stm_h8300s_3.
(*stm_h8300s_4): Change the name to stm_h8300s_4.
(*ldm_h8300s_2): New.
(*ldm_h8300s_3): Likewise.
(*ldm_h8300s_4): Likewise.
(return): Likewise.
(*return_1): Likewise.
(prologue): Likewise.
(epilogue): Likewise.
(monitor_prologue): Likewise.
2003-01-03 Dale Johannesen <dalej@apple.com>
* config/darwin.h: (EXTRA_SECTIONS): Add machopic_symbol_stub1,
......
......@@ -90,6 +90,9 @@ extern int h8300_tiny_data_p PARAMS ((tree));
#endif /* TREE_CODE */
extern void h8300_init_once PARAMS ((void));
extern int h8300_can_use_return_insn_p PARAMS ((void));
extern void h8300_expand_prologue PARAMS ((void));
extern void h8300_expand_epilogue PARAMS ((void));
extern int h8300_current_function_interrupt_function_p PARAMS ((void));
extern void asm_file_start PARAMS ((FILE *));
extern void asm_file_end PARAMS ((FILE *));
......
......@@ -51,7 +51,8 @@
;; ----------------------------------------------------------------------
(define_constants
[(UNSPEC_INCDEC 0)])
[(UNSPEC_INCDEC 0)
(UNSPEC_MONITOR 1)])
(define_constants
[(SC_REG 3)
......@@ -1783,7 +1784,32 @@
;; PROLOGUE/EPILOGUE-RELATED INSTRUCTIONS
;; ----------------------------------------------------------------------
(define_insn "*stm_h8300s_2"
(define_expand "push_h8300"
[(set (mem:HI (pre_dec:HI (reg:HI SP_REG)))
(match_operand:HI 0 "register_operand" "=r"))]
"TARGET_H8300"
"")
(define_expand "push_h8300hs"
[(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
(match_operand:SI 0 "register_operand" "=r"))]
"TARGET_H8300H && TARGET_H8300S"
"")
(define_expand "pop_h8300"
[(set (match_operand:HI 0 "register_operand" "=r")
(mem:HI (post_inc:HI (reg:HI SP_REG))))]
"TARGET_H8300"
"")
(define_expand "pop_h8300hs"
[(set (match_operand:SI 0 "register_operand" "=r")
(mem:SI (post_inc:SI (reg:SI SP_REG))))]
"TARGET_H8300H && TARGET_H8300S"
"")
(define_insn "stm_h8300s_2"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int -8)))
......@@ -1799,7 +1825,7 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
(define_insn "*stm_h8300s_3"
(define_insn "stm_h8300s_3"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int -12)))
......@@ -1820,7 +1846,7 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
(define_insn "*stm_h8300s_4"
(define_insn "stm_h8300s_4"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int -16)))
......@@ -1840,6 +1866,107 @@
"stm.l\\t%S0-%S3,@-er7"
[(set_attr "cc" "none")
(set_attr "length" "4")])
(define_insn "ldm_h8300s_2"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int 8)))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int 4)))
(match_operand:SI 0 "register_operand" ""))
(set (mem:SI (reg:SI SP_REG))
(match_operand:SI 1 "register_operand" ""))])]
"TARGET_H8300S
&& ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
|| (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
|| (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
"ldm.l\\t@er7+,%S0-%S1"
[(set_attr "cc" "none")
(set_attr "length" "4")])
(define_insn "ldm_h8300s_3"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int 12)))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int 8)))
(match_operand:SI 0 "register_operand" ""))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int 4)))
(match_operand:SI 1 "register_operand" ""))
(set (mem:SI (reg:SI SP_REG))
(match_operand:SI 2 "register_operand" ""))])]
"TARGET_H8300S
&& ((REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2)
|| (REGNO (operands[0]) == 4
&& REGNO (operands[1]) == 5
&& REGNO (operands[2]) == 6))"
"ldm.l\\t@er7+,%S0-%S2"
[(set_attr "cc" "none")
(set_attr "length" "4")])
(define_insn "ldm_h8300s_4"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int 16)))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int 12)))
(match_operand:SI 0 "register_operand" ""))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int 8)))
(match_operand:SI 1 "register_operand" ""))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int 4)))
(match_operand:SI 2 "register_operand" ""))
(set (mem:SI (reg:SI SP_REG))
(match_operand:SI 3 "register_operand" ""))])]
"TARGET_H8300S
&& REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2
&& REGNO (operands[3]) == 3"
"ldm.l\\t@er7+,%S0-%S3"
[(set_attr "cc" "none")
(set_attr "length" "4")])
(define_expand "return"
[(return)]
"h8300_can_use_return_insn_p ()"
"")
(define_insn "*return_1"
[(return)]
"reload_completed"
"*
{
if (h8300_current_function_interrupt_function_p ())
return \"rte\";
else
return \"rts\";
}"
[(set_attr "cc" "none")
(set_attr "length" "2")])
(define_expand "prologue"
[(const_int 0)]
""
"h8300_expand_prologue (); DONE;")
(define_expand "epilogue"
[(return)]
""
"h8300_expand_epilogue ();")
(define_insn "monitor_prologue"
[(unspec_volatile [(const_int 0)] UNSPEC_MONITOR)]
""
"*
{
if (TARGET_H8300)
return \"subs\\t#2,r7\;mov.w\\tr0,@-r7\;stc\\tccr,r0l\;mov.b\tr0l,@(2,r7)\;mov.w\\t@r7+,r0\;orc\t#128,ccr\";
else if (TARGET_H8300H)
return \"mov.l\\ter0,@-er7\;stc\\tccr,r0l\;mov.b\\tr0l,@(4,er7)\;mov.l\\t@er7+,er0\;orc\\t#128,ccr\";
else if (TARGET_H8300S)
return \"stc\texr,@-er7\;mov.l\\ter0,@-er7\;stc\tccr,r0l\;mov.b\tr0l,@(6,er7)\;mov.l\\t@er7+,er0\;orc\t#128,ccr\";
}"
[(set_attr "length" "20")
(set_attr "cc" "clobber")])
;; ----------------------------------------------------------------------
;; EXTEND INSTRUCTIONS
......
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