Commit 72a10eff by Roger Sayle Committed by Roger Sayle

expr.c (force_operand): Use expand_fix and expand_float to implement integer <->…

expr.c (force_operand): Use expand_fix and expand_float to implement integer <-> FP conversions instead...


	* expr.c (force_operand): Use expand_fix and expand_float to
	implement integer <-> FP conversions instead of convert_to_mode.

From-SVN: r109041
parent 4fe70c9b
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> 2005-12-24 Mark Mitchell <mark@codesourcery.com>
PR c++/23171 PR c++/23171
......
...@@ -5805,15 +5805,6 @@ force_operand (rtx value, rtx target) ...@@ -5805,15 +5805,6 @@ force_operand (rtx value, rtx target)
return subtarget; 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)) if (ARITHMETIC_P (value))
{ {
op2 = XEXP (value, 1); op2 = XEXP (value, 1);
...@@ -5885,17 +5876,27 @@ force_operand (rtx value, rtx target) ...@@ -5885,17 +5876,27 @@ force_operand (rtx value, rtx target)
} }
if (UNARY_P (value)) if (UNARY_P (value))
{ {
int unsignedp = 0; if (!target)
target = gen_reg_rtx (GET_MODE (value));
op1 = force_operand (XEXP (value, 0), NULL_RTX); op1 = force_operand (XEXP (value, 0), NULL_RTX);
switch (code) switch (code)
{ {
case ZERO_EXTEND: case UNSIGNED_FIX: case UNSIGNED_FLOAT: case ZERO_EXTEND:
unsignedp = 1; case SIGN_EXTEND:
/* fall through. */
case TRUNCATE: case TRUNCATE:
case SIGN_EXTEND: case FIX: case FLOAT: convert_move (target, op1, code == ZERO_EXTEND);
return convert_to_mode (GET_MODE (value), op1, unsignedp); 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: default:
return expand_simple_unop (GET_MODE (value), code, op1, target, 0); return expand_simple_unop (GET_MODE (value), code, op1, target, 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