Commit 37811a73 by Richard Kenner

(store_split_bit_field): When adjust arg in BYTES_BIT_ENDIAN case...

(store_split_bit_field): When adjust arg in BYTES_BIT_ENDIAN case, use
number of bits in arg for MEM operands and BITS_PER_WORD for other
operands.
(extract_fixed_bit_field): Undo last change.

From-SVN: r9911
parent 68450062
...@@ -770,6 +770,16 @@ store_split_bit_field (op0, bitsize, bitpos, value, align) ...@@ -770,6 +770,16 @@ store_split_bit_field (op0, bitsize, bitpos, value, align)
if (BYTES_BIG_ENDIAN) if (BYTES_BIG_ENDIAN)
{ {
int total_bits;
/* We must do an endian conversion exactly the same way as it is
done in extract_bit_field, so that the two calls to
extract_fixed_bit_field will have comparable arguments. */
if (GET_CODE (value) != MEM)
total_bits = BITS_PER_WORD;
else
total_bits = GET_MODE_BITSIZE (GET_MODE (value));
/* Fetch successively less significant portions. */ /* Fetch successively less significant portions. */
if (GET_CODE (value) == CONST_INT) if (GET_CODE (value) == CONST_INT)
part = GEN_INT (((unsigned HOST_WIDE_INT) (INTVAL (value)) part = GEN_INT (((unsigned HOST_WIDE_INT) (INTVAL (value))
...@@ -780,8 +790,7 @@ store_split_bit_field (op0, bitsize, bitpos, value, align) ...@@ -780,8 +790,7 @@ store_split_bit_field (op0, bitsize, bitpos, value, align)
lsb. Give extract_bit_field the value it needs (with lsb. Give extract_bit_field the value it needs (with
endianness compensation) to fetch the piece we want. */ endianness compensation) to fetch the piece we want. */
part = extract_fixed_bit_field (word_mode, value, 0, thissize, part = extract_fixed_bit_field (word_mode, value, 0, thissize,
GET_MODE_BITSIZE (GET_MODE (value)) total_bits - bitsize + bitsdone,
- bitsize + bitsdone,
NULL_RTX, 1, align); NULL_RTX, 1, align);
} }
else else
...@@ -1362,7 +1371,7 @@ extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos, ...@@ -1362,7 +1371,7 @@ extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos,
int unsignedp; int unsignedp;
int align; int align;
{ {
int total_bits; int total_bits = BITS_PER_WORD;
enum machine_mode mode; enum machine_mode mode;
if (GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG) if (GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG)
...@@ -1371,9 +1380,6 @@ extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos, ...@@ -1371,9 +1380,6 @@ extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos,
if (bitsize + bitpos > BITS_PER_WORD) if (bitsize + bitpos > BITS_PER_WORD)
return extract_split_bit_field (op0, bitsize, bitpos, return extract_split_bit_field (op0, bitsize, bitpos,
unsignedp, align); unsignedp, align);
mode = GET_MODE (op0);
total_bits = GET_MODE_BITSIZE (mode);
} }
else else
{ {
...@@ -1414,6 +1420,8 @@ extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos, ...@@ -1414,6 +1420,8 @@ extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos,
plus_constant (XEXP (op0, 0), offset)); plus_constant (XEXP (op0, 0), offset));
} }
mode = GET_MODE (op0);
if (BYTES_BIG_ENDIAN) if (BYTES_BIG_ENDIAN)
{ {
/* BITPOS is the distance between our msb and that of OP0. /* BITPOS is the distance between our msb and that of OP0.
......
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