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]

i386 codegen tweek 1


Hi,
this patch adds new target tweek FAST_PREFIX set for CPUs where prefix has zero
decoding cost (as oposed to early CPUs where prefix counts as instruction).
THis lets us to avoid some code size bloat.
I've also enabled promote_QImode for Athlon as it should result in slightly
shorter code at the average now.

Tue Jun 11 15:28:31 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* i386.c (x86_promote_QImode): Set for Athlon
	(x86_fast_prefix): New global variable.
	(x86_arch_always_fancy_math_387): Fix formating.
	* i386.h (x86_fast_prefix): Declare
	(TARGET_FAST_PREFIX): define.
	* i386.md (and to strict_low_part, HI to SI
	promoting splitter): Use new macro.
*** i386.c.old	Mon Jun 10 23:41:03 2002
--- i386.c	Tue Jun 11 15:22:08 2002
*************** const int x86_use_cltd = ~(m_PENT | m_K6
*** 376,382 ****
  const int x86_read_modify_write = ~m_PENT;
  const int x86_read_modify = ~(m_PENT | m_PPRO);
  const int x86_split_long_moves = m_PPRO;
! const int x86_promote_QImode = m_K6 | m_PENT | m_386 | m_486;
  const int x86_single_stringop = m_386 | m_PENT4;
  const int x86_qimode_math = ~(0);
  const int x86_promote_qi_regs = 0;
--- 376,383 ----
  const int x86_read_modify_write = ~m_PENT;
  const int x86_read_modify = ~(m_PENT | m_PPRO);
  const int x86_split_long_moves = m_PPRO;
! const int x86_promote_QImode = m_K6 | m_PENT | m_386 | m_486 | m_ATHLON;
! const int x86_fast_prefix = ~(m_PENT | m_486 | m_386);
  const int x86_single_stringop = m_386 | m_PENT4;
  const int x86_qimode_math = ~(0);
  const int x86_promote_qi_regs = 0;
*************** const int x86_accumulate_outgoing_args =
*** 393,399 ****
  const int x86_prologue_using_move = m_ATHLON | m_PENT4 | m_PPRO;
  const int x86_epilogue_using_move = m_ATHLON | m_PENT4 | m_PPRO;
  const int x86_decompose_lea = m_PENT4;
! const int x86_arch_always_fancy_math_387 = m_PENT|m_PPRO|m_ATHLON|m_PENT4;
  
  /* In case the avreage insn count for single function invocation is
     lower than this constant, emit fast (but longer) prologue and
--- 394,400 ----
  const int x86_prologue_using_move = m_ATHLON | m_PENT4 | m_PPRO;
  const int x86_epilogue_using_move = m_ATHLON | m_PENT4 | m_PPRO;
  const int x86_decompose_lea = m_PENT4;
! const int x86_arch_always_fancy_math_387 = m_PENT | m_PPRO | m_ATHLON | m_PENT4;
  
  /* In case the avreage insn count for single function invocation is
     lower than this constant, emit fast (but longer) prologue and
*** i386.h.old	Mon Jun 10 23:43:00 2002
--- i386.h	Mon Jun 10 23:44:19 2002
*************** extern const int x86_double_with_add, x8
*** 215,221 ****
  extern const int x86_use_loop, x86_use_fiop, x86_use_mov0;
  extern const int x86_use_cltd, x86_read_modify_write;
  extern const int x86_read_modify, x86_split_long_moves;
! extern const int x86_promote_QImode, x86_single_stringop;
  extern const int x86_himode_math, x86_qimode_math, x86_promote_qi_regs;
  extern const int x86_promote_hi_regs, x86_integer_DFmode_moves;
  extern const int x86_add_esp_4, x86_add_esp_8, x86_sub_esp_4, x86_sub_esp_8;
--- 215,221 ----
  extern const int x86_use_loop, x86_use_fiop, x86_use_mov0;
  extern const int x86_use_cltd, x86_read_modify_write;
  extern const int x86_read_modify, x86_split_long_moves;
! extern const int x86_promote_QImode, x86_single_stringop, x86_fast_prefix;
  extern const int x86_himode_math, x86_qimode_math, x86_promote_qi_regs;
  extern const int x86_promote_hi_regs, x86_integer_DFmode_moves;
  extern const int x86_add_esp_4, x86_add_esp_8, x86_sub_esp_4, x86_sub_esp_8;
*************** extern int x86_prefetch_sse;
*** 247,252 ****
--- 247,253 ----
  #define TARGET_READ_MODIFY_WRITE (x86_read_modify_write & CPUMASK)
  #define TARGET_READ_MODIFY (x86_read_modify & CPUMASK)
  #define TARGET_PROMOTE_QImode (x86_promote_QImode & CPUMASK)
+ #define TARGET_FAST_PREFIX (x86_fast_prefix & CPUMASK)
  #define TARGET_SINGLE_STRINGOP (x86_single_stringop & CPUMASK)
  #define TARGET_QIMODE_MATH (x86_qimode_math & CPUMASK)
  #define TARGET_HIMODE_MATH (x86_himode_math & CPUMASK)
*** i386.md.old	Mon Jun 10 23:41:06 2002
--- i386.md	Tue Jun 11 03:05:58 2002
***************
*** 7881,7887 ****
  	(and (match_dup 0)
  	     (const_int -65536)))
     (clobber (reg:CC 17))]
!   "optimize_size"
    [(set (strict_low_part (match_dup 1)) (const_int 0))]
    "operands[1] = gen_lowpart (HImode, operands[0]);")
  
--- 7881,7887 ----
  	(and (match_dup 0)
  	     (const_int -65536)))
     (clobber (reg:CC 17))]
!   "optimize_size || TARGET_FAST_PREFIX"
    [(set (strict_low_part (match_dup 1)) (const_int 0))]
    "operands[1] = gen_lowpart (HImode, operands[0]);")
  
***************
*** 16334,16340 ****
     (clobber (reg:CC 17))]
    "! TARGET_PARTIAL_REG_STALL && reload_completed
     && ((GET_MODE (operands[0]) == HImode 
! 	&& (!optimize_size || GET_CODE (operands[2]) != CONST_INT
  	    || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')))
         || (GET_MODE (operands[0]) == QImode 
  	   && (TARGET_PROMOTE_QImode || optimize_size)))"
--- 16334,16341 ----
     (clobber (reg:CC 17))]
    "! TARGET_PARTIAL_REG_STALL && reload_completed
     && ((GET_MODE (operands[0]) == HImode 
! 	&& ((!optimize_size && !TARGET_FAST_PREFIX)
! 	    || GET_CODE (operands[2]) != CONST_INT
  	    || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')))
         || (GET_MODE (operands[0]) == QImode 
  	   && (TARGET_PROMOTE_QImode || optimize_size)))"


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