aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-10-11 03:49:54 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-10-11 03:49:54 +0000
commitdd0ba2813d6150d6b4c8ddbf9f259c6efbba110f (patch)
tree21edeff789f11f21f721ad4c372bd423b1038dca /gcc/optabs.c
parent796d7a8605529b8a88f0f3eebf6a3fc4316a1d4a (diff)
downloadgcc-dd0ba2813d6150d6b4c8ddbf9f259c6efbba110f.zip
gcc-dd0ba2813d6150d6b4c8ddbf9f259c6efbba110f.tar.gz
gcc-dd0ba2813d6150d6b4c8ddbf9f259c6efbba110f.tar.bz2
cse.c (constant_pool_entries_regcost): New global variable to hold the register cost component of...
* cse.c (constant_pool_entries_regcost): New global variable to hold the register cost component of constant_pool_entries_cost. (fold_rtx): Calculate constant_pool_entries_regcost at the same time as constant_pool_entries_cost. (cse_insn): Set both src_folded_cost and src_folded_regcost from constant_pool_entries_cost and constant_pool_entries_regcost. (cse_main): Initialize constant_pool_entries_regcost to zero. * optabs.c (expand_unop): Attach a REG_EQUAL note describing the semantics of the sequence of bit operations used to negate a floating-point value. (expand_abs_nojump): Likewise attach a REG_EQUAL note describing the semantics of the bit operations used to abs a floating point value. From-SVN: r72326
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index e29c92a..10a3809 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -2615,7 +2615,16 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
immed_double_const (lo, hi, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
if (temp != 0)
- return gen_lowpart (mode, temp);
+ {
+ rtx insn;
+ if (target == 0)
+ target = gen_reg_rtx (mode);
+ insn = emit_move_insn (target, gen_lowpart (mode, temp));
+ set_unique_reg_note (insn, REG_EQUAL,
+ gen_rtx_fmt_e (NEG, mode,
+ copy_rtx (op0)));
+ return target;
+ }
delete_insns_since (last);
}
}
@@ -2790,7 +2799,16 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
immed_double_const (~lo, ~hi, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
if (temp != 0)
- return gen_lowpart (mode, temp);
+ {
+ rtx insn;
+ if (target == 0)
+ target = gen_reg_rtx (mode);
+ insn = emit_move_insn (target, gen_lowpart (mode, temp));
+ set_unique_reg_note (insn, REG_EQUAL,
+ gen_rtx_fmt_e (ABS, mode,
+ copy_rtx (op0)));
+ return target;
+ }
delete_insns_since (last);
}
}