Commit 4392ebd3 by Richard Sandiford Committed by Richard Sandiford

sh.md (udivsi3): Don't put udivsi3_i4_media instructions into a libcall block.

	* config/sh/sh.md (udivsi3): Don't put udivsi3_i4_media instructions
	into a libcall block.
	(divsi3): Likewise divsi3_i4_media.

From-SVN: r59299
parent 3748bd9e
2002-11-20 Richard Sandiford <rsandifo@redhat.com> 2002-11-20 Richard Sandiford <rsandifo@redhat.com>
* config/sh/sh.md (udivsi3): Don't put udivsi3_i4_media instructions
into a libcall block.
(divsi3): Likewise divsi3_i4_media.
2002-11-20 Richard Sandiford <rsandifo@redhat.com>
* global.c (find_reg): Check HARD_REGNO_NREGS before kicking * global.c (find_reg): Check HARD_REGNO_NREGS before kicking
out another register. out another register.
......
...@@ -1341,7 +1341,7 @@ ...@@ -1341,7 +1341,7 @@
"" ""
" "
{ {
rtx first = 0, last; rtx first, last;
operands[3] = gen_reg_rtx (Pmode); operands[3] = gen_reg_rtx (Pmode);
/* Emit the move of the address to a pseudo outside of the libcall. */ /* Emit the move of the address to a pseudo outside of the libcall. */
...@@ -1358,8 +1358,8 @@ ...@@ -1358,8 +1358,8 @@
{ {
operands[1] = force_reg (SImode, operands[1]); operands[1] = force_reg (SImode, operands[1]);
operands[2] = force_reg (SImode, operands[2]); operands[2] = force_reg (SImode, operands[2]);
last = gen_udivsi3_i4_media (operands[0], operands[1], operands[2]); emit_insn (gen_udivsi3_i4_media (operands[0], operands[1], operands[2]));
first = last; DONE;
} }
else if (TARGET_SH5) else if (TARGET_SH5)
{ {
...@@ -1386,11 +1386,8 @@ ...@@ -1386,11 +1386,8 @@
gen_rtx_SYMBOL_REF (SImode, \"__udivsi3\")); gen_rtx_SYMBOL_REF (SImode, \"__udivsi3\"));
last = gen_udivsi3_i1 (operands[0], operands[3]); last = gen_udivsi3_i1 (operands[0], operands[3]);
} }
if (! first) first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]);
{ emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]);
first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]);
emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]);
}
last = emit_insn (last); last = emit_insn (last);
/* Wrap the sequence in REG_LIBCALL / REG_RETVAL notes so that loop /* Wrap the sequence in REG_LIBCALL / REG_RETVAL notes so that loop
invariant code motion can move it. */ invariant code motion can move it. */
...@@ -1494,7 +1491,7 @@ ...@@ -1494,7 +1491,7 @@
"" ""
" "
{ {
rtx first = 0, last; rtx first, last;
operands[3] = gen_reg_rtx (Pmode); operands[3] = gen_reg_rtx (Pmode);
/* Emit the move of the address to a pseudo outside of the libcall. */ /* Emit the move of the address to a pseudo outside of the libcall. */
...@@ -1511,8 +1508,8 @@ ...@@ -1511,8 +1508,8 @@
{ {
operands[1] = force_reg (SImode, operands[1]); operands[1] = force_reg (SImode, operands[1]);
operands[2] = force_reg (SImode, operands[2]); operands[2] = force_reg (SImode, operands[2]);
last = gen_divsi3_i4_media (operands[0], operands[1], operands[2]); emit_insn (gen_divsi3_i4_media (operands[0], operands[1], operands[2]));
first = last; DONE;
} }
else if (TARGET_SH5) else if (TARGET_SH5)
{ {
...@@ -1538,11 +1535,8 @@ ...@@ -1538,11 +1535,8 @@
emit_move_insn (operands[3], gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3\")); emit_move_insn (operands[3], gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3\"));
last = gen_divsi3_i1 (operands[0], operands[3]); last = gen_divsi3_i1 (operands[0], operands[3]);
} }
if (! first) first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]);
{ emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]);
first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]);
emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]);
}
last = emit_insn (last); last = emit_insn (last);
/* Wrap the sequence in REG_LIBCALL / REG_RETVAL notes so that loop /* Wrap the sequence in REG_LIBCALL / REG_RETVAL notes so that loop
invariant code motion can move it. */ invariant code motion can move it. */
......
2002-11-20 Richard Sandiford <rsandifo@redhat.com> 2002-11-20 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/execute/20021120-2.c: New test.
2002-11-20 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/execute/20021120-1.c: New test. * gcc.c-torture/execute/20021120-1.c: New test.
2002-11-20 Jakub Jelinek <jakub@redhat.com> 2002-11-20 Jakub Jelinek <jakub@redhat.com>
......
int g1, g2;
void foo (int x)
{
int y;
if (x)
y = 793;
else
y = 793;
g1 = 7930 / y;
g2 = 7930 / x;
}
int main ()
{
foo (793);
if (g1 != 10 || g2 != 10)
abort ();
exit (0);
}
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