25112 Rev. 3.06 September 2005

Software Optimization Guide for AMD64 Processors

7.7Pushing Memory Data Directly onto the Stack

Optimization

Push memory data directly onto the stack instead of loading it into a register first.

Application

This optimization applies to:

32-bit software

64-bit software

Rationale

Pushing memory data directly onto the stack reduces register pressure and eliminates data dependencies.

Example

Avoid code that first loads the memory data into a register and then pushes it onto the stack:

mov rax, mem push rax

Instead, push the memory data directly onto the stack:

push mem

Chapter 7

Scheduling Optimizations

157

Page 173
Image 173
AMD 250 manual Pushing Memory Data Directly onto the Stack, 157