AMD Typewriter x86 사용자 설명서

다운로드
페이지 256
Use 8-Bit Sign-Extended Displacements
39
22007E/0—November 1999
AMD Athlon™ Processor x86 Code Optimization 
Use 8-Bit Sign-Extended Displacements
Use  8-bit sign-extende d displacements for  conditional
branches.  Using short, 8-bit sign-extended displacements for
conditional branches improves code density with no negative
effects on the AMD Athlon processor.
Code Padding Using Neutral Code Fillers
Occasionally a need arises to insert neutral code fillers into the
code stream, e.g., for code alignment purposes or to space out
branches. Since this filler code can be executed, it should take
up as few execution resources as possible, not diminish decode
density, and not modify any processor state other than
advancing EIP. A one byte padding can easily be achieved using
the NOP instructions (XCHG EAX, EAX; opcode 0x90). In the
x 8 6   a rch it e c t ure ,   t h e re   a re   s eve ra l   mu l t i - by t e   " N O P "
instructions available that do not change processor state other
than EIP:
MOV  REG, REG
XCHG REG, REG
CMOVcc REG, REG
SHR  REG, 0
SAR  REG, 0
SHL  REG, 0
SHRD REG, REG, 0
SHLD REG, REG, 0
LEA  REG, [REG]
LEA  REG, [REG+00]
LEA  REG, [REG*1+00]
LEA  REG, [REG+00000000]
LEA  REG, [REG*1+00000000]
Not all of these instructions are equally suitable for purposes of
code padding. For example, SHLD/SHRD are microcoded which
reduces decode bandwidth and takes up execution resources.