This is the mail archive of the gcc@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: leave instruction on ppro/pII/pIII



  In message <Pine.LNX.4.10.10005101428240.12070-100000@ns.netlink.ru>you write
:
  > It seems that gcc uses leave instruction only when generating code for
  > 386, amd k6 and athlon processors. On all others it uses an equivalent
  > movl %ebp,%esp popl %ebp sequence. I think that using leave on ppro, pII
  > and pIII could be advantageous for the following two reasons:
  > 
  > 1. Both leave and movl/popl are broken down to the same 3 micro-ops,
  > but leave is only one byte instruction, whereas a sequence of movl/popl
  > takes 3 bytes.
True, but in an out of order execution machine, you're better off generating
the simpler instructions as they can issue/retire interleaved with other
non-epilogue instructions.

It probably does make sense to use "leave" when optimizing for size though
and a patch to do this would be appreciated.  I'm much less sure about
using "leave" when not optimizing for size on ppro, PII & PIII.

jeff



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