Commit aa2ae679 by Jeffrey A Law Committed by Jeff Law

emit-rtl.c (operand_subword): Correctly handle extracting a word from a…

emit-rtl.c (operand_subword): Correctly handle extracting a word from a CONST_DOUBLE for 16bit targets with...

	* emit-rtl.c (operand_subword): Correctly handle extracting a word
	from a CONST_DOUBLE for 16bit targets with !WORDS_BIG_ENDIAN.

From-SVN: r17276
parent 9f1ff8e8
Thu Jan 1 10:49:12 1998 Jeffrey A Law (law@cygnus.com)
* emit-rtl.c (operand_subword): Correctly handle extracting a word
from a CONST_DOUBLE for 16bit targets with !WORDS_BIG_ENDIAN.
* mn10200.md (tstxx, cmpxx): Use "nonimmediate_operand" as predicate
for first argument.
......
......@@ -1208,7 +1208,7 @@ operand_subword (op, i, validate_address, mode)
{
long value;
value = k[i >> 1];
if ((i & 0x1) == 0)
if ((i & 0x1) == !WORDS_BIG_ENDIAN)
value >>= 16;
value &= 0xffff;
return GEN_INT ((HOST_WIDE_INT) value);
......@@ -1265,6 +1265,13 @@ operand_subword (op, i, validate_address, mode)
REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
REAL_VALUE_TO_TARGET_SINGLE (rv, l);
if (BITS_PER_WORD == 16)
{
if ((i & 0x1) == !WORDS_BIG_ENDIAN)
l >>= 16;
l &= 0xffff;
}
return GEN_INT ((HOST_WIDE_INT) l);
}
#else
......
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