Commit d3c64ee3 by Richard Stallman

(convert_move): Truncate via word_mode only if to_mode fits in one word.

Truncate by referring in TO_MODE for any FROM, but force_reg if nec.

From-SVN: r3553
parent 0df69870
...@@ -833,7 +833,9 @@ convert_move (to, from, unsignedp) ...@@ -833,7 +833,9 @@ convert_move (to, from, unsignedp)
return; return;
} }
if (GET_MODE_BITSIZE (from_mode) > BITS_PER_WORD) /* Truncating multi-word to a word or less. */
if (GET_MODE_BITSIZE (from_mode) > BITS_PER_WORD
&& GET_MODE_BITSIZE (to_mode) <= BITS_PER_WORD)
{ {
convert_move (to, gen_lowpart (word_mode, from), 0); convert_move (to, gen_lowpart (word_mode, from), 0);
return; return;
...@@ -881,19 +883,20 @@ convert_move (to, from, unsignedp) ...@@ -881,19 +883,20 @@ convert_move (to, from, unsignedp)
/* For truncation, usually we can just refer to FROM in a narrower mode. */ /* For truncation, usually we can just refer to FROM in a narrower mode. */
if (GET_MODE_BITSIZE (to_mode) < GET_MODE_BITSIZE (from_mode) if (GET_MODE_BITSIZE (to_mode) < GET_MODE_BITSIZE (from_mode)
&& TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (to_mode), && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (to_mode),
GET_MODE_BITSIZE (from_mode)) GET_MODE_BITSIZE (from_mode)))
&& ((GET_CODE (from) == MEM {
if (!((GET_CODE (from) == MEM
&& ! MEM_VOLATILE_P (from) && ! MEM_VOLATILE_P (from)
&& direct_load[(int) to_mode] && direct_load[(int) to_mode]
&& ! mode_dependent_address_p (XEXP (from, 0))) && ! mode_dependent_address_p (XEXP (from, 0)))
|| GET_CODE (from) == REG || GET_CODE (from) == REG
|| GET_CODE (from) == SUBREG)) || GET_CODE (from) == SUBREG))
{ from = force_reg (from_mode, from);
emit_move_insn (to, gen_lowpart (to_mode, from)); emit_move_insn (to, gen_lowpart (to_mode, from));
return; return;
} }
/* For truncation, usually we can just refer to FROM in a narrower mode. */ /* Handle extension. */
if (GET_MODE_BITSIZE (to_mode) > GET_MODE_BITSIZE (from_mode)) if (GET_MODE_BITSIZE (to_mode) > GET_MODE_BITSIZE (from_mode))
{ {
/* Convert directly if that works. */ /* Convert directly if that works. */
......
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