Commit 420e7dfa by Diego Novillo Committed by Diego Novillo

expmed.c (store_bit_field): Do not store bit fields using SUBREG operations if...


	* expmed.c (store_bit_field): Do not store bit fields using SUBREG
	operations if the field does not start at a mode boundary.

From-SVN: r49899
parent 1b7a2af6
2002-02-20 Diego Novillo <dnovillo@redhat.com>
* expmed.c (store_bit_field): Do not store bit fields using SUBREG
operations if the field does not start at a mode boundary.
2001-02-20 Joel Sherrill <joel@OARcorp.com> 2001-02-20 Joel Sherrill <joel@OARcorp.com>
* config/a29k/rtems.h, config/arm/rtems-elf.h, config/h8300/rtems.h, * config/a29k/rtems.h, config/arm/rtems-elf.h, config/h8300/rtems.h,
......
...@@ -299,6 +299,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) ...@@ -299,6 +299,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
unsigned HOST_WIDE_INT offset = bitnum / unit; unsigned HOST_WIDE_INT offset = bitnum / unit;
unsigned HOST_WIDE_INT bitpos = bitnum % unit; unsigned HOST_WIDE_INT bitpos = bitnum % unit;
rtx op0 = str_rtx; rtx op0 = str_rtx;
int byte_offset;
enum machine_mode op_mode = mode_for_extraction (EP_insv, 3); enum machine_mode op_mode = mode_for_extraction (EP_insv, 3);
...@@ -333,11 +334,15 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) ...@@ -333,11 +334,15 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
done with a simple store. For targets that support fast unaligned 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. */
byte_offset = (bitnum % BITS_PER_WORD) / BITS_PER_UNIT
+ (offset * UNITS_PER_WORD);
if (bitpos == 0 if (bitpos == 0
&& bitsize == GET_MODE_BITSIZE (fieldmode) && bitsize == GET_MODE_BITSIZE (fieldmode)
&& (GET_CODE (op0) != MEM && (GET_CODE (op0) != MEM
? (GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD ? ((GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD
|| GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode)) || GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode))
&& byte_offset % GET_MODE_SIZE (fieldmode) == 0)
: (! SLOW_UNALIGNED_ACCESS (fieldmode, MEM_ALIGN (op0)) : (! SLOW_UNALIGNED_ACCESS (fieldmode, MEM_ALIGN (op0))
|| (offset * BITS_PER_UNIT % bitsize == 0 || (offset * BITS_PER_UNIT % bitsize == 0
&& MEM_ALIGN (op0) % GET_MODE_BITSIZE (fieldmode) == 0)))) && MEM_ALIGN (op0) % GET_MODE_BITSIZE (fieldmode) == 0))))
...@@ -357,9 +362,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) ...@@ -357,9 +362,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
abort (); abort ();
} }
if (GET_CODE (op0) == REG) if (GET_CODE (op0) == REG)
op0 = gen_rtx_SUBREG (fieldmode, op0, op0 = gen_rtx_SUBREG (fieldmode, op0, byte_offset);
(bitnum % BITS_PER_WORD) / BITS_PER_UNIT
+ (offset * UNITS_PER_WORD));
else else
op0 = adjust_address (op0, fieldmode, offset); op0 = adjust_address (op0, fieldmode, offset);
} }
......
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