Commit 4ee16841 by Doug Evans

(extract_split_bit_field): Set UNIT to BITS_PER_WORD for register values.

(store_split_bit_field): Likewise.  Call operand_subword_force.

From-SVN: r7684
parent 9fd5bb62
...@@ -694,10 +694,15 @@ store_split_bit_field (op0, bitsize, bitpos, value, align) ...@@ -694,10 +694,15 @@ store_split_bit_field (op0, bitsize, bitpos, value, align)
rtx value; rtx value;
int align; int align;
{ {
int unit;
int bitsdone = 0;
/* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that /* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that
much at a time. */ much at a time. */
int unit = MIN (align * BITS_PER_UNIT, BITS_PER_WORD); if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG)
int bitsdone = 0; unit = BITS_PER_WORD;
else
unit = MIN (align * BITS_PER_UNIT, BITS_PER_WORD);
/* If VALUE is a constant other than a CONST_INT, get it into a register in /* If VALUE is a constant other than a CONST_INT, get it into a register in
WORD_MODE. If we can do this using gen_lowpart_common, do so. Note WORD_MODE. If we can do this using gen_lowpart_common, do so. Note
...@@ -767,22 +772,19 @@ store_split_bit_field (op0, bitsize, bitpos, value, align) ...@@ -767,22 +772,19 @@ store_split_bit_field (op0, bitsize, bitpos, value, align)
the current word starting from the base register. */ the current word starting from the base register. */
if (GET_CODE (op0) == SUBREG) if (GET_CODE (op0) == SUBREG)
{ {
word = operand_subword (SUBREG_REG (op0), word = operand_subword_force (SUBREG_REG (op0),
SUBREG_WORD (op0) + offset, 1, SUBREG_WORD (op0) + offset,
GET_MODE (SUBREG_REG (op0))); GET_MODE (SUBREG_REG (op0)));
offset = 0; offset = 0;
} }
else if (GET_CODE (op0) == REG) else if (GET_CODE (op0) == REG)
{ {
word = operand_subword (op0, offset, 1, GET_MODE (op0)); word = operand_subword_force (op0, offset, GET_MODE (op0));
offset = 0; offset = 0;
} }
else else
word = op0; word = op0;
if (word == 0)
abort ();
/* OFFSET is in UNITs, and UNIT is in bits. /* OFFSET is in UNITs, and UNIT is in bits.
store_fixed_bit_field wants offset in bytes. */ store_fixed_bit_field wants offset in bytes. */
store_fixed_bit_field (word, offset * unit / BITS_PER_UNIT, store_fixed_bit_field (word, offset * unit / BITS_PER_UNIT,
...@@ -1503,13 +1505,18 @@ extract_split_bit_field (op0, bitsize, bitpos, unsignedp, align) ...@@ -1503,13 +1505,18 @@ extract_split_bit_field (op0, bitsize, bitpos, unsignedp, align)
rtx op0; rtx op0;
int bitsize, bitpos, unsignedp, align; int bitsize, bitpos, unsignedp, align;
{ {
/* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that int unit;
much at a time. */
int unit = MIN (align * BITS_PER_UNIT, BITS_PER_WORD);
int bitsdone = 0; int bitsdone = 0;
rtx result; rtx result;
int first = 1; int first = 1;
/* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that
much at a time. */
if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG)
unit = BITS_PER_WORD;
else
unit = MIN (align * BITS_PER_UNIT, BITS_PER_WORD);
while (bitsdone < bitsize) while (bitsdone < bitsize)
{ {
int thissize; int thissize;
...@@ -1547,9 +1554,6 @@ extract_split_bit_field (op0, bitsize, bitpos, unsignedp, align) ...@@ -1547,9 +1554,6 @@ extract_split_bit_field (op0, bitsize, bitpos, unsignedp, align)
else else
word = op0; word = op0;
if (word == 0)
abort ();
/* Extract the parts in bit-counting order, /* Extract the parts in bit-counting order,
whose meaning is determined by BYTES_PER_UNIT. whose meaning is determined by BYTES_PER_UNIT.
OFFSET is in UNITs, and UNIT is in bits. OFFSET is in UNITs, and UNIT is in bits.
......
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