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]

x86_64 prologues tweek


Hi,
to decide whether to use push or moves in the i386 prologue we use average
amount of instruction the execution of function takes.  This works pretty well
for i386 where we have 1-3 registers to save, but on Hammer we save up to 6
registers that may become significantly expensive when done via push.  It works
much better when the number of instructions is multiply of the nuymber of
registers to be pushed.

Honza

Sun Nov 24 00:29:38 CET 2002  Jan Hubicka  <jh@suse.cz>
	* i386.c  (FAST_PROLOGUE_INSN_COUNT): Set to 20.
	(ix86_expand_prologue): Multiply the count by amount of registers to be
	pushed.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.446.2.5
diff -c -3 -p -r1.446.2.5 i386.c
*** i386.c	16 Nov 2002 17:32:53 -0000	1.446.2.5
--- i386.c	23 Nov 2002 23:28:37 -0000
*************** const int x86_sse_load0_by_pxor = m_PPRO
*** 464,470 ****
  /* In case the avreage insn count for single function invocation is
     lower than this constant, emit fast (but longer) prologue and
     epilogue code.  */
! #define FAST_PROLOGUE_INSN_COUNT 30
  
  /* Set by prologue expander and used by epilogue expander to determine
     the style used.  */
--- 464,470 ----
  /* In case the avreage insn count for single function invocation is
     lower than this constant, emit fast (but longer) prologue and
     epilogue code.  */
! #define FAST_PROLOGUE_INSN_COUNT 20
  
  /* Set by prologue expander and used by epilogue expander to determine
     the style used.  */
*************** ix86_expand_prologue ()
*** 4602,4615 ****
    int use_mov = 0;
    HOST_WIDE_INT allocate;
  
    if (!optimize_size)
      {
        use_fast_prologue_epilogue
! 	 = !expensive_function_p (FAST_PROLOGUE_INSN_COUNT);
        if (TARGET_PROLOGUE_USING_MOVE)
          use_mov = use_fast_prologue_epilogue;
      }
-   ix86_compute_frame_layout (&frame);
  
    /* Note: AT&T enter does NOT have reversed args.  Enter is probably
       slower on all targets.  Also sdb doesn't like it.  */
--- 4602,4615 ----
    int use_mov = 0;
    HOST_WIDE_INT allocate;
  
+   ix86_compute_frame_layout (&frame);
    if (!optimize_size)
      {
        use_fast_prologue_epilogue
! 	 = !expensive_function_p (frame.nregs ? (frame.nregs - 1) * FAST_PROLOGUE_INSN_COUNT : 0);
        if (TARGET_PROLOGUE_USING_MOVE)
          use_mov = use_fast_prologue_epilogue;
      }
  
    /* Note: AT&T enter does NOT have reversed args.  Enter is probably
       slower on all targets.  Also sdb doesn't like it.  */


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