The MASM Forum

Projects => MASM32 => Topic started by: gmmo1971 on February 07, 2013, 08:50:08 AM

Title: can't enable vector (SSE2) instructions
Post by: gmmo1971 on February 07, 2013, 08:50:08 AM
Hi, I am using VS2008 MASM:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin>ml.exe
Microsoft (R) Macro Assembler Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: ML [ options ] filelist [ /link linkoptions]
Run "ML /help" or "ML /?" for more info

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin>

however no matter what I cannot get it to accept SSE2 instructions:

I googled around and I tried this:

.686
.XMM
.MODEL FLAT

but when I try to assemble this:

   movss       xmm0,dword ptr [ebx+8]

I always get this error:

1>.\weighted_avg.asm(87) : error A2085:instruction or register not accepted in current CPU mode

Anyone knows how to enable this?

thx!
Title: Re: can't enable vector (SSE2) instructions
Post by: jj2007 on February 07, 2013, 08:54:35 AM
Assembles with ML 6.15, 8.0, 9.0 and 10.0 but not with JWasm:

include \masm32\include\masm32rt.inc
.xmm

.code
start:
   exit
   movss xmm0, dword ptr [ebx+8]
end start


P.S.: Your example works, too, with ML 9.0
Title: Re: can't enable vector (SSE2) instructions
Post by: dedndave on February 07, 2013, 08:55:24 AM
first lines.....

Code: [Select]
        .686p
        .MODEL  Flat,StdCall
        OPTION  CaseMap:None
        .MMX
        .XMM
Title: Re: can't enable vector (SSE2) instructions
Post by: qWord on February 07, 2013, 09:02:38 AM
works perfect for ml 9.00.30729.01 - maybe there is an include file that change the instruction set.
Title: Re: can't enable vector (SSE2) instructions
Post by: gmmo1971 on February 07, 2013, 09:16:26 AM
still not working for me...Is there a project settings I need to enable.

I moved to VS2010 and I get this:

.686p
.MODEL  Flat,StdCall
OPTION  CaseMap:None
.MMX
.XMM


On thing however is that my code is in 32-bit mode, should I be in 64-bit?

1>  Assembling [Inputs]...
1>weighted_avg.asm(90): error A2085: instruction or register not accepted in current CPU mode
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\masm.targets(49,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\weighted_avg.obj" /W3 /errorReport:prompt /Fl /Taweighted_avg.asm" exited with code 1.
Title: Re: can't enable vector (SSE2) instructions
Post by: gmmo1971 on February 07, 2013, 09:27:33 AM
never mind figured out.

my project was including another file that was turning the directive offs.

thx!
Title: Re: can't enable vector (SSE2) instructions
Post by: Gunther on February 07, 2013, 09:51:30 AM
Hi  gmmo1971,

by the way: .MMX isn't really necessary if you don't use MMX instructions.

Gunther