* expmed.c (store_bit_field, extract_bit_field): Can use a
plain move instruction if bitsize >= GET_MODE_BITSIZE of
destination/source mode, respectively.
===================================================================
Index: gcc/expmed.c
--- gcc/expmed.c 26 Sep 2003 13:28:45 -0000 1.143
+++ gcc/expmed.c 25 Oct 2003 01:12:35 -0000
@@ -326,13 +326,16 @@ store_bit_field (rtx str_rtx, unsigned H
If the target is memory, storing any naturally aligned field can
be
done with a simple store. For targets that support fast
unaligned
- memory, any naturally sized, unit aligned field can be done
directly. */
+ memory, any naturally sized, unit aligned field can be done
directly.
+
+ It's okay if the requested bitsize is greater than fieldmode's
+ bitsize; that just means the mode has padding bits. */
byte_offset = (bitnum % BITS_PER_WORD) / BITS_PER_UNIT
+ (offset * UNITS_PER_WORD);
if (bitpos == 0
- && bitsize == GET_MODE_BITSIZE (fieldmode)
+ && bitsize >= GET_MODE_BITSIZE (fieldmode)
&& (GET_CODE (op0) != MEM
? ((GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD
|| GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode))
@@ -1029,9 +1032,11 @@ extract_bit_field (rtx str_rtx, unsigned
if (GET_CODE (op0) == REG
&& mode == GET_MODE (op0)
&& bitnum == 0
- && bitsize == GET_MODE_BITSIZE (GET_MODE (op0)))
+ && bitsize >= GET_MODE_BITSIZE (GET_MODE (op0)))
{
- /* We're trying to extract a full register from itself. */
+ /* We're trying to extract a full register from itself.
+ (If the requested bitsize is greater than the bitsize of op0,
+ that just means op0's mode has padding bits.) */
return op0;
}