The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: liamo1 on September 01, 2010, 08:21:59 PM

Title: SSE problems with MASM 10?
Post by: liamo1 on September 01, 2010, 08:21:59 PM
I get the error

error A2070:invalid instruction operands

on the following line of code

movsd   xmm1, [edi] ;copy edi into xmm1. high quadword is zeroed out.

It compiled ok with previous versions of ml. Just wondering if anyone else came across this?

Liam
Title: Re: SSE problems with MASM 10?
Post by: clive on September 01, 2010, 09:04:16 PM
If in doubt, use the linker for MASM 10.00 to disassemble your earlier code. LINK -dump -disasm FOO.EXE

Microsoft (R) Macro Assembler Version 10.00.30319.01     09/01/10 16:01:24
test44.asm      Page 1 - 1


        .686
        .XMM
        .MODEL FLAT

00000000         .CODE

00000000 _start:

00000000  F2/ 0F 10 0F         movsd   xmm1, mmword ptr [edi]
00000004  F2/ 0F 11 33         movsd   mmword ptr [ebx], xmm6

00000008  C3         ret

        END     _start
Title: Re: SSE problems with MASM 10?
Post by: jj2007 on September 01, 2010, 10:05:02 PM
Your options:
movlps xmm0, qword ptr [edi] ; does not clear the high quadword
movsd xmm1, qword ptr [edi] ; chokes with ML 6.15
movq xmm2, qword ptr [edi] ; does clear the high quadword

Title: Re: SSE problems with MASM 10?
Post by: liamo1 on September 02, 2010, 04:09:54 PM
Just an update. Thanks to jj2007 I used the qword ptr prefix on [edi] and it worked with both movsd and movq. movapd did not throw this error!

Thanks
Liam
Title: Re: SSE problems with MASM 10?
Post by: Rockoon on September 02, 2010, 04:29:01 PM
With movapd, qword is implicit.