* config/tc-mips.c (macro): Rework division code to avoid unfilled

delay slot.
This commit is contained in:
Jeff Law
1998-01-15 00:08:12 +00:00
parent 52dcb248fb
commit 6c4b811d6a
2 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,8 @@
Wed Jan 14 15:41:41 1998 Jeffrey A Law (law@cygnus.com)
* config/tc-mips.c (macro): Rework division code to avoid unfilled
delay slot.
start-sanitize-d30v start-sanitize-d30v
Wed Jan 14 18:04:20 1998 Michael Meissner <meissner@cygnus.com> Wed Jan 14 18:04:20 1998 Michael Meissner <meissner@cygnus.com>

View File

@ -3864,16 +3864,20 @@ macro (ip)
mips_emit_delays (true); mips_emit_delays (true);
++mips_opts.noreorder; ++mips_opts.noreorder;
mips_any_noreorder = 1; mips_any_noreorder = 1;
if (mips_trap)
{
macro_build ((char *) NULL, &icnt, NULL, "teq", "s,t", treg, 0);
macro_build ((char *) NULL, &icnt, NULL, macro_build ((char *) NULL, &icnt, NULL,
dbl ? "ddiv" : "div", dbl ? "ddiv" : "div",
"z,s,t", sreg, treg); "z,s,t", sreg, treg);
if (mips_trap) }
macro_build ((char *) NULL, &icnt, NULL, "teq", "s,t", treg, 0);
else else
{ {
expr1.X_add_number = 8; expr1.X_add_number = 8;
macro_build ((char *) NULL, &icnt, &expr1, "bne", "s,t,p", treg, 0); macro_build ((char *) NULL, &icnt, &expr1, "bne", "s,t,p", treg, 0);
macro_build ((char *) NULL, &icnt, NULL, "nop", "", 0); macro_build ((char *) NULL, &icnt, NULL,
dbl ? "ddiv" : "div",
"z,s,t", sreg, treg);
macro_build ((char *) NULL, &icnt, NULL, "break", "c", 7); macro_build ((char *) NULL, &icnt, NULL, "break", "c", 7);
} }
expr1.X_add_number = -1; expr1.X_add_number = -1;
@ -4005,14 +4009,16 @@ macro (ip)
mips_emit_delays (true); mips_emit_delays (true);
++mips_opts.noreorder; ++mips_opts.noreorder;
mips_any_noreorder = 1; mips_any_noreorder = 1;
macro_build ((char *) NULL, &icnt, NULL, s, "z,s,t", sreg, treg);
if (mips_trap) if (mips_trap)
{
macro_build ((char *) NULL, &icnt, NULL, "teq", "s,t", treg, 0); macro_build ((char *) NULL, &icnt, NULL, "teq", "s,t", treg, 0);
macro_build ((char *) NULL, &icnt, NULL, s, "z,s,t", sreg, treg);
}
else else
{ {
expr1.X_add_number = 8; expr1.X_add_number = 8;
macro_build ((char *) NULL, &icnt, &expr1, "bne", "s,t,p", treg, 0); macro_build ((char *) NULL, &icnt, &expr1, "bne", "s,t,p", treg, 0);
macro_build ((char *) NULL, &icnt, NULL, "nop", "", 0); macro_build ((char *) NULL, &icnt, NULL, s, "z,s,t", sreg, treg);
macro_build ((char *) NULL, &icnt, NULL, "break", "c", 7); macro_build ((char *) NULL, &icnt, NULL, "break", "c", 7);
} }
--mips_opts.noreorder; --mips_opts.noreorder;