Translating an instruction sequence into a diagram
Hello you guys I did a diagram of the instruction sequence and how it would be decoded into operations. I also showed how the data dependencies between them would create a critical path of operations. My only question is simply if I did this correctly, i was confused at how to find %rbx as well. Please ask me any question you may have over my diagram, right now it is a rough draft. Thank you for your time.
.L15: # loop: vmovsd 0(%rbp,%rcx,8), %xmm1 vmulsd (%rax,%rcx,8), %xmm1, %xmm1 vaddsd %xmm1, %xmm0, %xmm0 addq $1, %rcx cmpq %rbx, %rcx jl .L15 # If <, goto loop
BTW, IACA can generate diagrams like this for you. It's closed-source freeware from Intel, and works on Linux.
You should distinguish integer add from FP addsd and mulsd.
Jester's right, xmm1 should be coming from the vmovsd load.
vaddsd writes xmm0. You're using AT&T syntax, so the destination is the last operand. Your diagram shows it modifying xmm1, but xmm0 is actually the accumulator.
add modifies rcx, but your diagram doesn't reflect that. The dependency chain involving rcx is what forms the loop, so an arrow going back upwards would make sense there.
Like for xmm0, the arrows should form a cycle (closed loop).
re: your comment: The code has two instructions with memory source operands, so there are two loads.