Assembly x64: Using MULPD instruction with integer

363 views Asked by At

I am learning SSE instructions right now. But I can't explain this behavior of MULPD bcause it doesn't display the correct value (for example; -9080 * 21 = -190680). But this one below display the original value of XMM0 even after mulpd instructon. Doesnt the answer should be xmm0 = xmm0 * xmm1?

format PE64 console
include 'win64a.inc'

    movdqa  xmm0,dqword[x]
    movdqa  xmm1,dqword[y]
    mulpd   xmm0,xmm1               ;xmm0 = -9080 * 21 | -67 * -89
    movhpd  qword[z],xmm0           ;copy higher portion
    invoke  printf,addr c,[z]       ;why -9080?
    invoke  exit,0

    align 16
    x dq -67,-9080
    y dq -89,21
    z dq 0
    c db "%d",0ah,0

Appreciate your help.

0

There are 0 answers