From 4ee16841d49a370564703362a152dfd75412d6ad Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Fri, 8 Jul 1994 21:16:01 +0000 Subject: [PATCH] (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 --- gcc/expmed.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/gcc/expmed.c b/gcc/expmed.c index 72fca3ddda2..5b2d61ef270 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. -- 2.30.2