Commit 46d00fef by Kazu Hirata Committed by Kazu Hirata

h8300.c (function_prologue): Fix code for a monitor function.

2001-01-09  Kazu Hirata  <kazu@hxi.com>

	* config/h8300/h8300.c (function_prologue): Fix code for a
	monitor function.  Support H8/S.
	(function_epilogue): Do not output pop for a monitor function.

From-SVN: r38840
parent 9789584b
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
shift_mode. Remove an extra error check. shift_mode. Remove an extra error check.
(emit_a_shift): Adopt to the new calling prototype of (emit_a_shift): Adopt to the new calling prototype of
get_shift_alg. get_shift_alg.
(function_prologue): Fix code for a monitor
function. Support H8/S.
(function_epilogue): Do not output pop for a monitor function.
2001-01-09 Nick Clifton <nickc@redhat.com> 2001-01-09 Nick Clifton <nickc@redhat.com>
......
...@@ -297,16 +297,29 @@ function_prologue (file, size) ...@@ -297,16 +297,29 @@ function_prologue (file, size)
fprintf (file, "\tsubs\t#2,sp\n"); fprintf (file, "\tsubs\t#2,sp\n");
push (file, 0); push (file, 0);
fprintf (file, "\tstc\tccr,r0l\n"); fprintf (file, "\tstc\tccr,r0l\n");
fprintf (file, "\tmov.b\tr0l,@(2,sp)\n");
pop (file, 0);
fprintf (file, "\torc\t#128,ccr\n"); fprintf (file, "\torc\t#128,ccr\n");
}
else if (TARGET_H8300H)
{
push (file, 0);
fprintf (file, "\tstc\tccr,r0l\n");
fprintf (file, "\tmov.b\tr0l,@(4,sp)\n"); fprintf (file, "\tmov.b\tr0l,@(4,sp)\n");
pop (file, 0);
fprintf (file, "\torc\t#128,ccr\n");
} }
else else if (TARGET_H8300S)
{ {
fprintf (file, "\tstc\texr,@-sp\n");
push (file, 0); push (file, 0);
fprintf (file, "\tstc\tccr,r0l\n"); fprintf (file, "\tstc\tccr,r0l\n");
fprintf (file, "\tmov.b\tr0l,@(6,sp)\n");
pop (file, 0);
fprintf (file, "\torc\t#128,ccr\n"); fprintf (file, "\torc\t#128,ccr\n");
fprintf (file, "\tmov.b\tr0l,@(4,sp)\n");
} }
else
abort ();
} }
if (frame_pointer_needed) if (frame_pointer_needed)
...@@ -430,11 +443,6 @@ function_epilogue (file, size) ...@@ -430,11 +443,6 @@ function_epilogue (file, size)
if (frame_pointer_needed) if (frame_pointer_needed)
pop (file, FRAME_POINTER_REGNUM); pop (file, FRAME_POINTER_REGNUM);
/* If this is a monitor function, there is one register still left on
the stack. */
if (monitor)
pop (file, 0);
if (interrupt_handler) if (interrupt_handler)
fprintf (file, "\trte\n"); fprintf (file, "\trte\n");
else else
......
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