Apress/modern-x86-assembly-language-programming-2e

possible error in Chapter 5 example 8

Opened this issue · 0 comments

In Chapter 5 example 8 : CalcMatrixSquaresF32_ is what I believe an error. The value of xmm0 must be saved to xmm2 before the first loop otherwise the calculations are wrong. Now the value of xmm0 (which is the offset from main.cpp) is overwritten by y[i][j].

; Initialize pointers to source and destination arrays
mov rsi,rdx ;rsi = x
mov rdi,rcx ;rdi = y
xor rcx,rcx ;rcx = i
vmovss xmm2,xmm0 <---