Chapter 6 Branch Optimizations 129
Software Optimization Guide for AMD64 Processors
25112 Rev. 3.06 September 2005
If possible, move an existing instruction, such as a POP instruction that is part of the function
epilogue, so that it is inserted between the branch and the RET instruction:
jz label
pop ebp ; Pad with at least one non-branch instruction.
ret
If no existing instruction is available for this purpose, then insert a NOP instruction to provide the
necessary padding or, better still, use the recommended two-byte version of RET.