Hi

I am puttimg together something using SSE2. The Move Scalar Double Precision command is not assembling using MASM 6.15.8803. It gives a "invalid instruction operands" error. Is there a simple way around this?

Thanks in advance
Liamo
Posted on 2004-07-12 16:56:30 by Liamo
Works fine with "Microsoft (R) Macro Assembler Version 7.10.3077". However Olly misreports the encoding, but movsd xmm0,xmm1 is correctly encoded as F2 0F 10 C1
Posted on 2004-07-12 17:16:38 by donkey

Hi

I am puttimg together something using SSE2. The Move Scalar Double Precision command is not assembling using MASM 6.15.8803. It gives a "invalid instruction operands" error. Is there a simple way around this?

Thanks in advance
Liamo


That usually means you didn't use the command correctly. Can you post the 3 lines of code ( one before it, and the one after it).
Posted on 2004-07-12 17:17:53 by mark_larson
Thanks for the rapid reply. Below find some of the code. The code is incomplete at this point but assembles correctly if i remove the line containing the movsd command.



add edi,eax
sub ecx, 2
jz end_dasum
jmp general_case1

singlevalueleft:
movsd xmm1, xmm2





end_dasum:
unpcklpd xmm1, xmm2
;unpckhpd xmm2, xmm2
addpd xmm2, xmm1
movlpd answer, xmm2

Thanks again
Liamo
Posted on 2004-07-12 17:21:52 by Liamo
Changed to version 7 of MASM and the prog assembles correctly. Thanks for thew replies.

Liamo
Posted on 2004-07-12 18:11:29 by Liamo

Thanks for the rapid reply. Below find some of the code. The code is incomplete at this point but assembles correctly if i remove the line containing the movsd command.



add edi,eax
sub ecx, 2
jz end_dasum
jmp general_case1

singlevalueleft:
movsd xmm1, xmm2





end_dasum:
unpcklpd xmm1, xmm2
;unpckhpd xmm2, xmm2
addpd xmm2, xmm1
movlpd answer, xmm2

Thanks again
Liamo


I also have 6.15, and I tried your code and it doesn't compile on my system either. I verified that the usage for the instruction was correct. Looks like a MASM 6.15 bug since Donkey says 7.0 works. So instead I wrote my own macro to simulate MOVSD.



MOVSDmac macro reg1:req, reg2:req
local start_modify
local end_modify

start_modify equ $
movss reg1,reg2 ;I am modifying MOVSS to become MOVSD.
end_modify equ $
org (start_modify) ;Go back to the "F3" and change it to an "F2".
db 0F2h ;Change the MOVSS from a "F3 0F 10 /r" to a ""F2 0F 10 /r"" which is a MOVSD.
; Also change the "F3 0F 11 /r" to a ""F2 0F 11 /r".
org (end_modify) ;Go back to the last byte.
endm


I tested it with the following:



movsd xmm1,xmm2
movsd xmm1,[test_list]
movsd xmm1,es:[test_list]


In the 3 cases above it generated the correct opcodes. I have not done extensive testing. So keep that in mind.
Posted on 2004-07-12 18:17:33 by mark_larson