aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2012-05-06 18:55:20 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2012-05-06 18:55:20 +0000
commit69523a7c8957851d9fa168edc6baf175c6bf54b6 (patch)
tree38d5ee74697d7aec32694c08a36c9d4d17ab1fcf
parent4fe977f2d691e6c3b03056a5d9eae223d67ac526 (diff)
downloadgcc-69523a7c8957851d9fa168edc6baf175c6bf54b6.zip
gcc-69523a7c8957851d9fa168edc6baf175c6bf54b6.tar.gz
gcc-69523a7c8957851d9fa168edc6baf175c6bf54b6.tar.bz2
lower-subreg.c (shift_cost): Use set_src_cost, avoiding the SET.
gcc/ * lower-subreg.c (shift_cost): Use set_src_cost, avoiding the SET. (compute_costs): Likewise for the zero extension. Use set_rtx_cost to compute the cost of moves. Set the mode of the target register. From-SVN: r187212
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lower-subreg.c15
2 files changed, 12 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 364d2d7..8d6637f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-06 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lower-subreg.c (shift_cost): Use set_src_cost, avoiding the SET.
+ (compute_costs): Likewise for the zero extension. Use set_rtx_cost
+ to compute the cost of moves. Set the mode of the target register.
+
2012-05-05 Richard Sandiford <rdsandiford@googlemail.com>
* rtl.h (plus_constant, plus_constant_mode): Merge into a single
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index a11b33d..4a92275 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -135,13 +135,11 @@ static int
shift_cost (bool speed_p, struct cost_rtxes *rtxes, enum rtx_code code,
enum machine_mode mode, int op1)
{
- PUT_MODE (rtxes->target, mode);
PUT_CODE (rtxes->shift, code);
PUT_MODE (rtxes->shift, mode);
PUT_MODE (rtxes->source, mode);
XEXP (rtxes->shift, 1) = GEN_INT (op1);
- SET_SRC (rtxes->set) = rtxes->shift;
- return insn_rtx_cost (rtxes->set, speed_p);
+ return set_src_cost (rtxes->shift, speed_p);
}
/* For each X in the range [0, BITS_PER_WORD), set SPLITTING[X]
@@ -189,11 +187,12 @@ compute_costs (bool speed_p, struct cost_rtxes *rtxes)
unsigned int i;
int word_move_zero_cost, word_move_cost;
+ PUT_MODE (rtxes->target, word_mode);
SET_SRC (rtxes->set) = CONST0_RTX (word_mode);
- word_move_zero_cost = insn_rtx_cost (rtxes->set, speed_p);
+ word_move_zero_cost = set_rtx_cost (rtxes->set, speed_p);
SET_SRC (rtxes->set) = rtxes->source;
- word_move_cost = insn_rtx_cost (rtxes->set, speed_p);
+ word_move_cost = set_rtx_cost (rtxes->set, speed_p);
if (LOG_COSTS)
fprintf (stderr, "%s move: from zero cost %d, from reg cost %d\n",
@@ -209,7 +208,7 @@ compute_costs (bool speed_p, struct cost_rtxes *rtxes)
PUT_MODE (rtxes->target, mode);
PUT_MODE (rtxes->source, mode);
- mode_move_cost = insn_rtx_cost (rtxes->set, speed_p);
+ mode_move_cost = set_rtx_cost (rtxes->set, speed_p);
if (LOG_COSTS)
fprintf (stderr, "%s move: original cost %d, split cost %d * %d\n",
@@ -236,10 +235,8 @@ compute_costs (bool speed_p, struct cost_rtxes *rtxes)
/* The only case here to check to see if moving the upper part with a
zero is cheaper than doing the zext itself. */
- PUT_MODE (rtxes->target, twice_word_mode);
PUT_MODE (rtxes->source, word_mode);
- SET_SRC (rtxes->set) = rtxes->zext;
- zext_cost = insn_rtx_cost (rtxes->set, speed_p);
+ zext_cost = set_src_cost (rtxes->zext, speed_p);
if (LOG_COSTS)
fprintf (stderr, "%s %s: original cost %d, split cost %d + %d\n",