diff options
author | Zack Weinberg <zackw@panix.com> | 2001-08-24 16:01:42 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-08-24 16:01:42 +0000 |
commit | a242b0831cacdde49bc174bbf188cfdc2777bf80 (patch) | |
tree | 33a603de13883851b6faaf26026a8ea091b5422d /gcc | |
parent | 653753c5e73991a3bb3811f3a380f628a28de5da (diff) | |
download | gcc-a242b0831cacdde49bc174bbf188cfdc2777bf80.zip gcc-a242b0831cacdde49bc174bbf188cfdc2777bf80.tar.gz gcc-a242b0831cacdde49bc174bbf188cfdc2777bf80.tar.bz2 |
expmed.c: Default-#define HAVE_insv, HAVE_extv, and HAVE_extzv to zero.
* expmed.c: Default-#define HAVE_insv, HAVE_extv, and HAVE_extzv
to zero.
(mode_for_extraction): No need for #ifdefs. Add default-case abort
to switch.
(store_bit_field): Eliminate insv_bitsize variable. Put HAVE_insv
in if controlling use of insv.
(extract_bit_field): Likewise, for extv and extzv.
From-SVN: r45150
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/expmed.c | 51 |
2 files changed, 28 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a447776..b401093 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2001-08-24 Zack Weinberg <zackw@panix.com> + + * expmed.c: Default-#define HAVE_insv, HAVE_extv, and HAVE_extzv + to zero. + (mode_for_extraction): No need for #ifdefs. Add default-case abort + to switch. + (store_bit_field): Eliminate insv_bitsize variable. Put HAVE_insv + in if controlling use of insv. + (extract_bit_field): Likewise, for extv and extzv. + Fri Aug 24 17:27:46 CEST 2001 Jan Hubicka <jh@suse.cz> * i386.md (movcc peep2): Fix load of 0. diff --git a/gcc/expmed.c b/gcc/expmed.c index 7c1e0f6..7cbc857 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -77,14 +77,17 @@ static int sdiv_pow2_cheap, smod_pow2_cheap; /* Reduce conditional compilation elsewhere. */ #ifndef HAVE_insv +#define HAVE_insv 0 #define CODE_FOR_insv CODE_FOR_nothing #define gen_insv(a,b,c,d) NULL_RTX #endif #ifndef HAVE_extv +#define HAVE_extv 0 #define CODE_FOR_extv CODE_FOR_nothing #define gen_extv(a,b,c,d) NULL_RTX #endif #ifndef HAVE_extzv +#define HAVE_extzv 0 #define CODE_FOR_extzv CODE_FOR_nothing #define gen_extzv(a,b,c,d) NULL_RTX #endif @@ -232,34 +235,31 @@ mode_for_extraction (pattern, opno) switch (pattern) { case EP_insv: -#ifdef HAVE_insv if (HAVE_insv) { data = &insn_data[CODE_FOR_insv]; break; } -#endif return MAX_MACHINE_MODE; case EP_extv: -#ifdef HAVE_extv if (HAVE_extv) { data = &insn_data[CODE_FOR_extv]; break; } -#endif return MAX_MACHINE_MODE; case EP_extzv: -#ifdef HAVE_extzv if (HAVE_extzv) { data = &insn_data[CODE_FOR_extzv]; break; } -#endif return MAX_MACHINE_MODE; + + default: + abort (); } if (opno == -1) @@ -304,12 +304,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) unsigned HOST_WIDE_INT bitpos = bitnum % unit; register rtx op0 = str_rtx; - unsigned HOST_WIDE_INT insv_bitsize; - enum machine_mode op_mode; - - op_mode = mode_for_extraction (EP_insv, 3); - if (op_mode != MAX_MACHINE_MODE) - insv_bitsize = GET_MODE_BITSIZE (op_mode); + enum machine_mode op_mode = mode_for_extraction (EP_insv, 3); /* It is wrong to have align==0, since every object is aligned at least at a bit boundary. This usually means a bug elsewhere. */ @@ -542,13 +537,13 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) /* Now OFFSET is nonzero only if OP0 is memory and is therefore always measured in bytes. */ - if (op_mode != MAX_MACHINE_MODE + if (HAVE_insv && GET_MODE (value) != BLKmode && !(bitsize == 1 && GET_CODE (value) == CONST_INT) /* Ensure insv's size is wide enough for this field. */ - && (insv_bitsize >= bitsize) + && (GET_MODE_BITSIZE (op_mode) >= bitsize) && ! ((GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG) - && (bitsize + bitpos > insv_bitsize))) + && (bitsize + bitpos > GET_MODE_BITSIZE (op_mode)))) { int xbitpos = bitpos; rtx value1; @@ -1042,18 +1037,8 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, rtx spec_target = target; rtx spec_target_subreg = 0; enum machine_mode int_mode; - unsigned HOST_WIDE_INT extv_bitsize; - enum machine_mode extv_mode; - unsigned HOST_WIDE_INT extzv_bitsize; - enum machine_mode extzv_mode; - - extv_mode = mode_for_extraction (EP_extv, 0); - if (extv_mode != MAX_MACHINE_MODE) - extv_bitsize = GET_MODE_BITSIZE (extv_mode); - - extzv_mode = mode_for_extraction (EP_extzv, 0); - if (extzv_mode != MAX_MACHINE_MODE) - extzv_bitsize = GET_MODE_BITSIZE (extzv_mode); + enum machine_mode extv_mode = mode_for_extraction (EP_extv, 0); + enum machine_mode extzv_mode = mode_for_extraction (EP_extzv, 0); /* Discount the part of the structure before the desired byte. We need to know how many bytes are safe to reference after it. */ @@ -1287,10 +1272,10 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, if (unsignedp) { - if (extzv_mode != MAX_MACHINE_MODE - && (extzv_bitsize >= bitsize) + if (HAVE_extzv + && (GET_MODE_BITSIZE (extzv_mode) >= bitsize) && ! ((GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG) - && (bitsize + bitpos > extzv_bitsize))) + && (bitsize + bitpos > GET_MODE_BITSIZE (extzv_mode)))) { unsigned HOST_WIDE_INT xbitpos = bitpos, xoffset = offset; rtx bitsize_rtx, bitpos_rtx; @@ -1420,10 +1405,10 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, } else { - if (extv_mode != MAX_MACHINE_MODE - && (extv_bitsize >= bitsize) + if (HAVE_extv + && (GET_MODE_BITSIZE (extv_mode) >= bitsize) && ! ((GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG) - && (bitsize + bitpos > extv_bitsize))) + && (bitsize + bitpos > GET_MODE_BITSIZE (extv_mode)))) { int xbitpos = bitpos, xoffset = offset; rtx bitsize_rtx, bitpos_rtx; |