Commit 0d282692 by Roger Sayle Committed by Roger Sayle

expmed.c (expand_mult_highpart): Make static.


	* expmed.c (expand_mult_highpart): Make static.  Change type of
	constant multiplier argument from unsigned HOST_WIDE_INT to rtx.
	(expand_divmod): Updates calls to expand_mult_highpart by using
	gen_int_mode to pass a CONST_INT rtx.
	* rtl.h (expand_mult_highpart): Remove prototype.

From-SVN: r94139
parent 29105d25
2005-01-23 Roger Sayle <roger@eyesopen.com>
* expmed.c (expand_mult_highpart): Make static. Change type of
constant multiplier argument from unsigned HOST_WIDE_INT to rtx.
(expand_divmod): Updates calls to expand_mult_highpart by using
gen_int_mode to pass a CONST_INT rtx.
* rtl.h (expand_mult_highpart): Remove prototype.
2005-01-23 Kazu Hirata <kazu@cs.umass.edu> 2005-01-23 Kazu Hirata <kazu@cs.umass.edu>
* flow.c (regset_bytes, regset_size): Remove. * flow.c (regset_bytes, regset_size): Remove.
......
...@@ -2389,6 +2389,7 @@ static unsigned HOST_WIDE_INT choose_multiplier (unsigned HOST_WIDE_INT, int, ...@@ -2389,6 +2389,7 @@ static unsigned HOST_WIDE_INT choose_multiplier (unsigned HOST_WIDE_INT, int,
int *, int *); int *, int *);
static unsigned HOST_WIDE_INT invert_mod2n (unsigned HOST_WIDE_INT, int); static unsigned HOST_WIDE_INT invert_mod2n (unsigned HOST_WIDE_INT, int);
static rtx extract_high_half (enum machine_mode, rtx); static rtx extract_high_half (enum machine_mode, rtx);
static rtx expand_mult_highpart (enum machine_mode, rtx, rtx, rtx, int, int);
static rtx expand_mult_highpart_optab (enum machine_mode, rtx, rtx, rtx, static rtx expand_mult_highpart_optab (enum machine_mode, rtx, rtx, rtx,
int, int); int, int);
/* Compute and return the best algorithm for multiplying by T. /* Compute and return the best algorithm for multiplying by T.
...@@ -3359,9 +3360,10 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, ...@@ -3359,9 +3360,10 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
return 0; return 0;
} }
/* Emit code to multiply OP0 and CNST1, putting the high half of the result /* Emit code to multiply OP0 and OP1 (where OP1 is an integer constant),
in TARGET if that is convenient, and return where the result is. If the putting the high half of the result in TARGET if that is convenient,
operation can not be performed, 0 is returned. and return where the result is. If the operation can not be performed,
0 is returned.
MODE is the mode of operation and result. MODE is the mode of operation and result.
...@@ -3369,23 +3371,22 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, ...@@ -3369,23 +3371,22 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
MAX_COST is the total allowed cost for the expanded RTL. */ MAX_COST is the total allowed cost for the expanded RTL. */
rtx static rtx
expand_mult_highpart (enum machine_mode mode, rtx op0, expand_mult_highpart (enum machine_mode mode, rtx op0, rtx op1,
unsigned HOST_WIDE_INT cnst1, rtx target, rtx target, int unsignedp, int max_cost)
int unsignedp, int max_cost)
{ {
enum machine_mode wider_mode = GET_MODE_WIDER_MODE (mode); enum machine_mode wider_mode = GET_MODE_WIDER_MODE (mode);
unsigned HOST_WIDE_INT cnst1;
int extra_cost; int extra_cost;
bool sign_adjust = false; bool sign_adjust = false;
enum mult_variant variant; enum mult_variant variant;
struct algorithm alg; struct algorithm alg;
rtx op1, tem; rtx tem;
/* We can't support modes wider than HOST_BITS_PER_INT. */ /* We can't support modes wider than HOST_BITS_PER_INT. */
gcc_assert (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT); gcc_assert (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT);
op1 = gen_int_mode (cnst1, wider_mode); cnst1 = INTVAL (op1) & GET_MODE_MASK (mode);
cnst1 &= GET_MODE_MASK (mode);
/* We can't optimize modes wider than BITS_PER_WORD. /* We can't optimize modes wider than BITS_PER_WORD.
??? We might be able to perform double-word arithmetic if ??? We might be able to perform double-word arithmetic if
...@@ -3916,7 +3917,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -3916,7 +3917,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
= (shift_cost[compute_mode][post_shift - 1] = (shift_cost[compute_mode][post_shift - 1]
+ shift_cost[compute_mode][1] + shift_cost[compute_mode][1]
+ 2 * add_cost[compute_mode]); + 2 * add_cost[compute_mode]);
t1 = expand_mult_highpart (compute_mode, op0, ml, t1 = gen_int_mode (ml, compute_mode);
t1 = expand_mult_highpart (compute_mode, op0, t1,
NULL_RTX, 1, NULL_RTX, 1,
max_cost - extra_cost); max_cost - extra_cost);
if (t1 == 0) if (t1 == 0)
...@@ -3951,7 +3953,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -3951,7 +3953,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
extra_cost extra_cost
= (shift_cost[compute_mode][pre_shift] = (shift_cost[compute_mode][pre_shift]
+ shift_cost[compute_mode][post_shift]); + shift_cost[compute_mode][post_shift]);
t2 = expand_mult_highpart (compute_mode, t1, ml, t2 = gen_int_mode (ml, compute_mode);
t2 = expand_mult_highpart (compute_mode, t1, t2,
NULL_RTX, 1, NULL_RTX, 1,
max_cost - extra_cost); max_cost - extra_cost);
if (t2 == 0) if (t2 == 0)
...@@ -4072,7 +4075,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4072,7 +4075,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
extra_cost = (shift_cost[compute_mode][post_shift] extra_cost = (shift_cost[compute_mode][post_shift]
+ shift_cost[compute_mode][size - 1] + shift_cost[compute_mode][size - 1]
+ add_cost[compute_mode]); + add_cost[compute_mode]);
t1 = expand_mult_highpart (compute_mode, op0, ml, t1 = gen_int_mode (ml, compute_mode);
t1 = expand_mult_highpart (compute_mode, op0, t1,
NULL_RTX, 0, NULL_RTX, 0,
max_cost - extra_cost); max_cost - extra_cost);
if (t1 == 0) if (t1 == 0)
...@@ -4108,7 +4112,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4108,7 +4112,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
extra_cost = (shift_cost[compute_mode][post_shift] extra_cost = (shift_cost[compute_mode][post_shift]
+ shift_cost[compute_mode][size - 1] + shift_cost[compute_mode][size - 1]
+ 2 * add_cost[compute_mode]); + 2 * add_cost[compute_mode]);
t1 = expand_mult_highpart (compute_mode, op0, ml, t1 = gen_int_mode (ml, compute_mode);
t1 = expand_mult_highpart (compute_mode, op0, t1,
NULL_RTX, 0, NULL_RTX, 0,
max_cost - extra_cost); max_cost - extra_cost);
if (t1 == 0) if (t1 == 0)
...@@ -4202,7 +4207,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4202,7 +4207,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
extra_cost = (shift_cost[compute_mode][post_shift] extra_cost = (shift_cost[compute_mode][post_shift]
+ shift_cost[compute_mode][size - 1] + shift_cost[compute_mode][size - 1]
+ 2 * add_cost[compute_mode]); + 2 * add_cost[compute_mode]);
t3 = expand_mult_highpart (compute_mode, t2, ml, t3 = gen_int_mode (ml, compute_mode);
t3 = expand_mult_highpart (compute_mode, t2, t3,
NULL_RTX, 1, NULL_RTX, 1,
max_cost - extra_cost); max_cost - extra_cost);
if (t3 != 0) if (t3 != 0)
......
...@@ -2028,8 +2028,6 @@ extern void dump_flow_info (FILE *); ...@@ -2028,8 +2028,6 @@ extern void dump_flow_info (FILE *);
extern void init_expmed (void); extern void init_expmed (void);
extern void expand_inc (rtx, rtx); extern void expand_inc (rtx, rtx);
extern void expand_dec (rtx, rtx); extern void expand_dec (rtx, rtx);
extern rtx expand_mult_highpart (enum machine_mode, rtx,
unsigned HOST_WIDE_INT, rtx, int, int);
/* In gcse.c */ /* In gcse.c */
extern bool can_copy_p (enum machine_mode); extern bool can_copy_p (enum machine_mode);
......
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