The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: carl on December 12, 2006, 05:51:15 AM

Title: how to support sse2 ?
Post by: carl on December 12, 2006, 05:51:15 AM
Dear All:

I'm a starter with Masm .I want to use sse2 to optimize some procedure.but now some trouble is taken to me.
could someone help me ? thanks

the code is followed:
#####################################
.686p
.xmm
.model flat, stdcall
option casemap :none
.code

myasmproc proc dw1:DWORD,dw2:DWORD

push ebx;
push ebp;
mov ebp,esp;

mov eax,dw1
......
movapd xmm0,[eax];
xorpd xmm1,xmm1;
addpd xmm1,xmm0;
......
mov  esp,ebp;
pop  ebp;
pop  ebx;

ret
myasmproc endp
end
##########################

myasm.asm(17) : error A2006: undefined symbol : xmm0
myasm.asm(18) : error A2006: undefined symbol : xmm0
myasm.asm(19) : error A2006: undefined symbol : xmm1
Title: Re: how to support sse2 ?
Post by: Draakie on December 12, 2006, 06:12:09 AM
What Masm/Link version are you running ?
Title: Re: how to support sse2 ?
Post by: carl on December 12, 2006, 06:27:22 AM
masm32V8
Title: Re: how to support sse2 ?
Post by: hutch-- on December 12, 2006, 07:11:02 AM
Carl,

Two things, the version of ML.EXE in the masm32 project is not late enough to do sse2. You need ML 6.15 to do that. various sources for a later version, if you own the old VC6, get the processor pack on the forum web site, otherwise and late DDK or use the VC and MASM link above to do the big install of VC2005 and add the latest version of ML to it, version 8.00.
Title: Re: how to support sse2 ?
Post by: dsouza123 on December 12, 2006, 03:39:03 PM
The placement of .xmm makes a difference.

Once you are using a version of ML that supports the SSE2 instructions,
use the following order and then the case of xmm0 doesn't matter,
either all upper, XMM0 or all lower, xmm0 will work.

.686p
.model flat,stdcall
option casemap:none
.xmm
Title: Re: how to support sse2 ?
Post by: carl on December 19, 2006, 08:26:38 AM
thanks Draakie, hutch--, dsouza123

I use the order which dsouza123 said ,and  all is ok.

thank you.