This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: less use of optabs/insn-codes, 3/n


On Wed, Aug 22, 2001 at 03:48:19AM -0400, Zack Weinberg wrote:
> Would you mind doing the revert, and testing on an affected platform,
> since you have access to one?  I don't want to try doing it now,
> I'm tired enough that I'll probably mess it up even worse.

I just fixed it.


r~


        * expmed.c (CODE_FOR_insv, gen_insv): Provide defaults.
        (CODE_FOR_extv, gen_extv, CODE_FOR_extzv, gen_extzv): Likewise.
        (store_bit_field): Use mode_for_extraction more places.
        (extract_bit_field): Likewise.

Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.85
diff -c -p -d -r1.85 expmed.c
*** expmed.c	2001/08/22 00:33:33	1.85
--- expmed.c	2001/08/22 07:54:02
*************** static int sdiv_pow2_cheap, smod_pow2_ch
*** 75,80 ****
--- 75,94 ----
  #define MAX_BITS_PER_WORD BITS_PER_WORD
  #endif
  
+ /* Reduce conditional compilation elsewhere.  */
+ #ifndef HAVE_insv
+ #define CODE_FOR_insv	CODE_FOR_nothing
+ #define gen_insv(a,b,c,d) NULL_RTX
+ #endif
+ #ifndef HAVE_extv
+ #define CODE_FOR_extv	CODE_FOR_nothing
+ #define gen_extv(a,b,c,d) NULL_RTX
+ #endif
+ #ifndef HAVE_extzv
+ #define CODE_FOR_extzv	CODE_FOR_nothing
+ #define gen_extzv(a,b,c,d) NULL_RTX
+ #endif
+ 
  /* Cost of various pieces of RTL.  Note that some of these are indexed by
     shift count and some by mode.  */
  static int add_cost, negate_cost, zero_cost;
*************** store_bit_field (str_rtx, bitsize, bitnu
*** 541,553 ****
        rtx xop0 = op0;
        rtx last = get_last_insn ();
        rtx pat;
!       enum machine_mode maxmode;
        int save_volatile_ok = volatile_ok;
  
-       maxmode = insn_data[(int) CODE_FOR_insv].operand[3].mode;
-       if (maxmode == VOIDmode)
- 	maxmode = word_mode;
- 
        volatile_ok = 1;
  
        /* If this machine's insv can only insert into a register, copy OP0
--- 555,563 ----
        rtx xop0 = op0;
        rtx last = get_last_insn ();
        rtx pat;
!       enum machine_mode maxmode = mode_for_extraction (EP_insv, 3);
        int save_volatile_ok = volatile_ok;
  
        volatile_ok = 1;
  
        /* If this machine's insv can only insert into a register, copy OP0
*************** extract_bit_field (str_rtx, bitsize, bit
*** 1290,1300 ****
  	  rtx xspec_target = spec_target;
  	  rtx xspec_target_subreg = spec_target_subreg;
  	  rtx pat;
! 	  enum machine_mode maxmode;
! 
! 	  maxmode = insn_data[(int) CODE_FOR_extzv].operand[0].mode;
! 	  if (maxmode == VOIDmode)
! 	    maxmode = word_mode;
  
  	  if (GET_CODE (xop0) == MEM)
  	    {
--- 1300,1306 ----
  	  rtx xspec_target = spec_target;
  	  rtx xspec_target_subreg = spec_target_subreg;
  	  rtx pat;
! 	  enum machine_mode maxmode = mode_for_extraction (EP_extzv, 0);
  
  	  if (GET_CODE (xop0) == MEM)
  	    {
*************** extract_bit_field (str_rtx, bitsize, bit
*** 1426,1436 ****
  	  rtx xspec_target = spec_target;
  	  rtx xspec_target_subreg = spec_target_subreg;
  	  rtx pat;
! 	  enum machine_mode maxmode;
! 
! 	  maxmode = insn_data[(int) CODE_FOR_extv].operand[0].mode;
! 	  if (maxmode == VOIDmode)
! 	    maxmode = word_mode;
  
  	  if (GET_CODE (xop0) == MEM)
  	    {
--- 1432,1438 ----
  	  rtx xspec_target = spec_target;
  	  rtx xspec_target_subreg = spec_target_subreg;
  	  rtx pat;
! 	  enum machine_mode maxmode = mode_for_extraction (EP_extv, 0);
  
  	  if (GET_CODE (xop0) == MEM)
  	    {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]