Software Optimization Guide for AMD64 Processors

25112 Rev. 3.06 September 2005

Function arguments on the stack can now be accessed at positive offsets relative to rBP, and local variables are accessible at negative offsets relative to rBP.

Example

The traditional function epilogue looks like this:

mov

esp, ebp

;

Deallocate local variables

(only if space was allocated).

pop

ebp

;

Restore old frame pointer.

 

Replace the traditional function epilogue with a single LEAVE instruction:

leave

84

Instruction-Decoding Optimizations

Chapter 4

Page 100
Image 100
AMD 250 manual Traditional function epilogue looks like this