aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1994-07-08 21:16:01 +0000
committerDoug Evans <dje@gnu.org>1994-07-08 21:16:01 +0000
commit4ee16841d49a370564703362a152dfd75412d6ad (patch)
tree7b38a047710daa2eae4fd979fa453c32e0cac87d /gcc/expmed.c
parent9fd5bb6267ca1d3bca69e58b121fad23e9a45308 (diff)
downloadgcc-4ee16841d49a370564703362a152dfd75412d6ad.zip
gcc-4ee16841d49a370564703362a152dfd75412d6ad.tar.gz
gcc-4ee16841d49a370564703362a152dfd75412d6ad.tar.bz2
(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
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 72fca3d..5b2d61e 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -694,10 +694,15 @@ store_split_bit_field (op0, bitsize, bitpos, value, align)
rtx value;
int align;
{
+ int unit;
+ int bitsdone = 0;
+
/* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that
much at a time. */
- int unit = MIN (align * BITS_PER_UNIT, BITS_PER_WORD);
- int bitsdone = 0;
+ if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG)
+ 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
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)
the current word starting from the base register. */
if (GET_CODE (op0) == SUBREG)
{
- word = operand_subword (SUBREG_REG (op0),
- SUBREG_WORD (op0) + offset, 1,
- GET_MODE (SUBREG_REG (op0)));
+ word = operand_subword_force (SUBREG_REG (op0),
+ SUBREG_WORD (op0) + offset,
+ GET_MODE (SUBREG_REG (op0)));
offset = 0;
}
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;
}
else
word = op0;
- if (word == 0)
- abort ();
-
/* OFFSET is in UNITs, and UNIT is in bits.
store_fixed_bit_field wants offset in bytes. */
store_fixed_bit_field (word, offset * unit / BITS_PER_UNIT,
@@ -1503,13 +1505,18 @@ extract_split_bit_field (op0, bitsize, bitpos, unsignedp, align)
rtx op0;
int bitsize, bitpos, unsignedp, align;
{
- /* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that
- much at a time. */
- int unit = MIN (align * BITS_PER_UNIT, BITS_PER_WORD);
+ int unit;
int bitsdone = 0;
rtx result;
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)
{
int thissize;
@@ -1547,9 +1554,6 @@ extract_split_bit_field (op0, bitsize, bitpos, unsignedp, align)
else
word = op0;
- if (word == 0)
- abort ();
-
/* Extract the parts in bit-counting order,
whose meaning is determined by BYTES_PER_UNIT.
OFFSET is in UNITs, and UNIT is in bits.