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]
Other format: [Raw text]

Obvious patch for x86-64 insn costs


Hi,
for x86-64 the symbol refs to static variables are cheap.

Honza

Tue Mar 25 20:36:15 CET 2003  Jan Hubicka  <jh at suse dot cz>
	* i386.c (ix86_rtx_costs): For -fpic and x86-64 local symbolic
	constants are not expensive.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.552
diff -c -3 -p -r1.552 i386.c
*** i386.c	22 Mar 2003 20:02:22 -0000	1.552
--- i386.c	25 Mar 2003 19:43:42 -0000
*************** ix86_rtx_costs (x, code, outer_code, tot
*** 14939,14945 ****
  	*total = 3;
        else if (TARGET_64BIT && !x86_64_zero_extended_value (x))
  	*total = 2;
!       else if (flag_pic && SYMBOLIC_CONST (x))
  	*total = 1;
        else
  	*total = 0;
--- 14956,14966 ----
  	*total = 3;
        else if (TARGET_64BIT && !x86_64_zero_extended_value (x))
  	*total = 2;
!       else if (flag_pic && SYMBOLIC_CONST (x)
! 	       && (!TARGET_64BIT
! 		   || (!GET_CODE (x) != LABEL_REF
! 		       && (GET_CODE (x) != SYMBOL_REF
! 		           || !SYMBOL_REF_FLAG (x)))))
  	*total = 1;
        else
  	*total = 0;
*************** ix86_rtx_costs (x, code, outer_code, tot
*** 14962,14968 ****
  	    /* Start with (MEM (SYMBOL_REF)), since that's where
  	       it'll probably end up.  Add a penalty for size.  */
  	    *total = (COSTS_N_INSNS (1)
! 		      + (flag_pic != 0)
  		      + (mode == SFmode ? 0 : mode == DFmode ? 1 : 2));
  	    break;
  	  }
--- 14983,14989 ----
  	    /* Start with (MEM (SYMBOL_REF)), since that's where
  	       it'll probably end up.  Add a penalty for size.  */
  	    *total = (COSTS_N_INSNS (1)
! 		      + (flag_pic != 0 && !TARGET_64BIT)
  		      + (mode == SFmode ? 0 : mode == DFmode ? 1 : 2));
  	    break;
  	  }


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