Re: clock cycle values AMD manual




"roger21" asked:

just a newb question : where do i get the length of each instruction or
at last the number of clock cycle for each instruction in the amd docs ?

Most instructions got a variable length depending on involved
operands and addressing mode. That's why you only see
ie: MOV r,r/m |MOV r/m,r |and similar ...

use32: ;btw: almost equal timing for this three
01 07 add [edi],eax ;2 byte
01 47 55 add [edi+55h],eax ;3 byte
01 87 55 66 77 88 add [edi+88776655h],eax ;6 byte
....
use16: ;this seem to be the largest possible:
F0 65 66 67 81 84 87 10 20 30 40 50 60 70 80
LOCK ADD dword GS:[edi+eax*4+40302010h],80706050h ;15 byte

Exact calculation of code duration is a nightmare and almost
impossible on modern x86, it just depends on too many things.
But a rough estimation can be done with the latency/throughput
values found in "AMD Software Optimisation Guide"(s),
25412.pdf 24594.pdf and perhaps more.
__
wolfgang

.



Relevant Pages

  • Compiler error with Inline assembly
    ... mov rax, ... no instruction mnemonic suffix given and no register operands; ...
    (comp.os.linux.development.apps)
  • [PATCH -tip -v13 01/11] x86: instruction decoder API
    ... This version introduces instruction attributes for decoding instructions. ... The instruction attribute tables are generated from the opcode map file ... +88: MOV Eb,Gb ... +e0: LOOPNE/LOOPNZ Jb (f64) ...
    (Linux-Kernel)
  • [PATCH -tip v14 01/12] x86: instruction decoder API
    ... This version introduces instruction attributes for decoding instructions. ... The instruction attribute tables are generated from the opcode map file ... +88: MOV Eb,Gb ... +e0: LOOPNE/LOOPNZ Jb (f64) ...
    (Linux-Kernel)
  • [PATCH 01/18] x86: Instruction decoder API
    ... Add x86 instruction decoder to arch-specific libraries. ... The instruction attribute tables are generated from the opcode map file ... +88: MOV Eb,Gb ... +e0: LOOPNE/LOOPNZ Jb (f64) ...
    (Linux-Kernel)
  • [PATCH -tip v6 1/5] x86: instruction decorder API
    ... This version introduces instruction attributes for decoding instructions. ... The instruction attribute tables are generated from the opcode map file ... +88: MOV Eb,Gb ... +e0: LOOPNE/LOOPNZ Jb (f64) ...
    (Linux-Kernel)