Commit 665acd1e by Richard Kenner Committed by Richard Kenner

expmed.c (expand_mult_highpart_optab): Use narrower version of OP1 in two more…

expmed.c (expand_mult_highpart_optab): Use narrower version of OP1 in two more places; remove unneeded force_reg

	* expmed.c (expand_mult_highpart_optab): Use narrower version of OP1
	in two more places; remove unneeded force_reg

From-SVN: r80969
parent 86a80fc3
2004-04-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expmed.c (expand_mult_highpart_optab): Use narrower version of OP1
in two more places; remove unneeded force_reg
2004-04-21 Andrew Pinski <pinskia@physics.uc.edu> 2004-04-21 Andrew Pinski <pinskia@physics.uc.edu>
* config/rs6000/rs6000.c (symbol_ref_operand): Remove hack * config/rs6000/rs6000.c (symbol_ref_operand): Remove hack
......
...@@ -2883,6 +2883,7 @@ static rtx ...@@ -2883,6 +2883,7 @@ static rtx
expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
rtx target, int unsignedp, int max_cost) rtx target, int unsignedp, int max_cost)
{ {
rtx narrow_op1 = gen_int_mode (INTVAL (op1), mode);
enum machine_mode wider_mode; enum machine_mode wider_mode;
optab moptab; optab moptab;
rtx tem; rtx tem;
...@@ -2896,8 +2897,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, ...@@ -2896,8 +2897,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
if (mul_highpart_cost[(int) mode] < max_cost) if (mul_highpart_cost[(int) mode] < max_cost)
{ {
moptab = unsignedp ? umul_highpart_optab : smul_highpart_optab; moptab = unsignedp ? umul_highpart_optab : smul_highpart_optab;
tem = expand_binop (mode, moptab, op0, tem = expand_binop (mode, moptab, op0, narrow_op1, target,
gen_int_mode (INTVAL (op1), mode), target,
unsignedp, OPTAB_DIRECT); unsignedp, OPTAB_DIRECT);
if (tem) if (tem)
return tem; return tem;
...@@ -2910,8 +2910,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, ...@@ -2910,8 +2910,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
< max_cost)) < max_cost))
{ {
moptab = unsignedp ? smul_highpart_optab : umul_highpart_optab; moptab = unsignedp ? smul_highpart_optab : umul_highpart_optab;
tem = expand_binop (mode, moptab, op0, tem = expand_binop (mode, moptab, op0, narrow_op1, target,
gen_int_mode (INTVAL (op1), mode), target,
unsignedp, OPTAB_DIRECT); unsignedp, OPTAB_DIRECT);
if (tem) if (tem)
/* We used the wrong signedness. Adjust the result. */ /* We used the wrong signedness. Adjust the result. */
...@@ -2924,7 +2923,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, ...@@ -2924,7 +2923,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
if (moptab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing if (moptab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing
&& mul_widen_cost[(int) wider_mode] < max_cost) && mul_widen_cost[(int) wider_mode] < max_cost)
{ {
tem = expand_binop (wider_mode, moptab, op0, op1, 0, tem = expand_binop (wider_mode, moptab, op0, narrow_op1, 0,
unsignedp, OPTAB_WIDEN); unsignedp, OPTAB_WIDEN);
if (tem) if (tem)
return extract_high_half (mode, tem); return extract_high_half (mode, tem);
...@@ -2949,8 +2948,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, ...@@ -2949,8 +2948,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
&& (mul_widen_cost[(int) wider_mode] && (mul_widen_cost[(int) wider_mode]
+ 2 * shift_cost[size-1] + 4 * add_cost < max_cost)) + 2 * shift_cost[size-1] + 4 * add_cost < max_cost))
{ {
rtx regop1 = force_reg (mode, op1); tem = expand_binop (wider_mode, moptab, op0, narrow_op1,
tem = expand_binop (wider_mode, moptab, op0, regop1,
NULL_RTX, ! unsignedp, OPTAB_WIDEN); NULL_RTX, ! unsignedp, OPTAB_WIDEN);
if (tem != 0) if (tem != 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