aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-12-24 18:35:02 +0000
committerRoger Sayle <roger@eyesopen.com>2005-12-24 18:35:02 +0000
commitccf1593156da4d33ae307bfe6b3e8a15c7f55b45 (patch)
tree8bb34f32e31df100f54cdf9967ef00e0ac207219
parent24d2f03bdd5b4a65270e908bacfa478f83939557 (diff)
* expr.c (force_operand): Use expand_fix and expand_float to
implement integer <-> FP conversions instead of convert_to_mode. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@109041 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c33
2 files changed, 22 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a3fccff175..6d23fdc1121 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-24 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (force_operand): Use expand_fix and expand_float to
+ implement integer <-> FP conversions instead of convert_to_mode.
+
2005-12-24 Mark Mitchell <mark@codesourcery.com>
PR c++/23171
diff --git a/gcc/expr.c b/gcc/expr.c
index 322db4ff273..7a83b7e317f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5805,15 +5805,6 @@ force_operand (rtx value, rtx target)
return subtarget;
}
- if (code == ZERO_EXTEND || code == SIGN_EXTEND)
- {
- if (!target)
- target = gen_reg_rtx (GET_MODE (value));
- convert_move (target, force_operand (XEXP (value, 0), NULL),
- code == ZERO_EXTEND);
- return target;
- }
-
if (ARITHMETIC_P (value))
{
op2 = XEXP (value, 1);
@@ -5885,17 +5876,27 @@ force_operand (rtx value, rtx target)
}
if (UNARY_P (value))
{
- int unsignedp = 0;
-
+ if (!target)
+ target = gen_reg_rtx (GET_MODE (value));
op1 = force_operand (XEXP (value, 0), NULL_RTX);
switch (code)
{
- case ZERO_EXTEND: case UNSIGNED_FIX: case UNSIGNED_FLOAT:
- unsignedp = 1;
- /* fall through. */
+ case ZERO_EXTEND:
+ case SIGN_EXTEND:
case TRUNCATE:
- case SIGN_EXTEND: case FIX: case FLOAT:
- return convert_to_mode (GET_MODE (value), op1, unsignedp);
+ convert_move (target, op1, code == ZERO_EXTEND);
+ return target;
+
+ case FIX:
+ case UNSIGNED_FIX:
+ expand_fix (target, op1, code == UNSIGNED_FIX);
+ return target;
+
+ case FLOAT:
+ case UNSIGNED_FLOAT:
+ expand_float (target, op1, code == UNSIGNED_FLOAT);
+ return target;
+
default:
return expand_simple_unop (GET_MODE (value), code, op1, target, 0);
}