Author Topic: can't enable vector (SSE2) instructions  (Read 7302 times)

gmmo1971

  • Guest
can't enable vector (SSE2) instructions
« 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!

jj2007

  • Member
  • *****
  • Posts: 8896
  • Assembler is fun ;-)
    • MasmBasic
Re: can't enable vector (SSE2) instructions
« Reply #1 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

dedndave

  • Member
  • *****
  • Posts: 8807
  • Still using Abacus 2.0
    • DednDave
Re: can't enable vector (SSE2) instructions
« Reply #2 on: February 07, 2013, 08:55:24 AM »
first lines.....

Code: [Select]
        .686p
        .MODEL  Flat,StdCall
        OPTION  CaseMap:None
        .MMX
        .XMM

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: can't enable vector (SSE2) instructions
« Reply #3 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.
MREAL macros - when you need floating point arithmetic while assembling!

gmmo1971

  • Guest
Re: can't enable vector (SSE2) instructions
« Reply #4 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.

gmmo1971

  • Guest
Re: can't enable vector (SSE2) instructions
« Reply #5 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!

Gunther

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: can't enable vector (SSE2) instructions
« Reply #6 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
Get your facts first, and then you can distort them.