The MASM Forum Archive 2004 to 2012

Project Support Forums => MASM32 => Topic started by: hutch-- on March 07, 2005, 11:04:04 PM

Title: SSE2 macros for ML 6.14 by Daydreamer
Post by: hutch-- on March 07, 2005, 11:04:04 PM
Magnus is doing some great work here as his work will make ML 6.14 viable until the end of 32 bit Windows. I have re-attached his latest version of the macros so they are easier to find.

[attachment deleted by admin]
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: Jimg on March 08, 2005, 11:22:06 PM
I'm having a little trouble iincluding these macros.

This one doesn't look right:
ORPD MACRO M1,M2
    DB 066H
    ORPS MACRO M1,M2
ENDM


After fixing that, it hates these two:

CMPLTSD MACRO M1,M2
    DB 0F2H
    CMPLTPS M1,M2
END
andCMPSD MACRO M1,M2,M3
    DB 0F2H
    CMPPS M1,M2,M3
ENDM


The first one is missing then M on ENDM and CMPSD is reserved as a standard instruction.
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: daydreamer on March 09, 2005, 07:22:52 AM
thanks for the feedback Jim, fixed those
I dont have 6.14 so I could check them

[attachment deleted by admin]
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: hutch-- on March 09, 2005, 08:08:00 AM
Magnus,

Could you just get the 6.14 version of ML.EXE from MASM32 ? It would certainly make testing the macros a lot easier.

I keep a trick for different versions of ML, I have a couple of versions renamed and a batch file for each that overwrites the existing version with a copy of which ever one I choose to use.
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: hutch-- on March 10, 2005, 11:15:01 AM
I wonder if there is an easy solution to the ambiguous names of a few of the SSE2 instructions. From memory MOVSD has been reused but there is no reliable way unless something tricky was done.

You can remove MOVSD as a keyword and redefine it as a macro of the same name and determine if there are arguments or not but I am not sure it would work after REP which is how MOVSD is usually used.

The macro would basically be if there are no arguments then its an integer string instruction where if it is  an SSE2 instruction it will have parameters. I think they are complicated macros to write though.
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: AeroASM on March 11, 2005, 07:51:25 PM
Also in SSE and beyond, movdqa, movaps and movapd all do the same thing, yet they all have different encodings. Why?
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: daydreamer on March 22, 2005, 06:19:53 PM
Quote from: hutch-- on March 10, 2005, 11:15:01 AM
I wonder if there is an easy solution to the ambiguous names of a few of the SSE2 instructions. From memory MOVSD has been reused but there is no reliable way unless something tricky was done.

You can remove MOVSD as a keyword and redefine it as a macro of the same name and determine if there are arguments or not but I am not sure it would work after REP which is how MOVSD is usually used.

The macro would basically be if there are no arguments then its an integer string instruction where if it isĀ  an SSE2 instruction it will have parameters. I think they are complicated macros to write though.
OPTION NOKEYWORD:<CMPSD MOVSD etc

yes but how do I make MMX that takes .xmm regs instead of .mmx regs for SSE2 integer ones?
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: AeroASM on March 22, 2005, 06:23:29 PM
Just use the instruction: e.g. instead of paddd mm0,mm1 you would use paddd xmm0,xmm1.

If you need help look in the Intel IA-32 manuals
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: daydreamer on March 22, 2005, 06:56:44 PM
Quote from: AeroASM on March 22, 2005, 06:23:29 PM
Just use the instruction: e.g. instead of paddd mm0,mm1 you would use paddd xmm0,xmm1.

If you need help look in the Intel IA-32 manuals
no I need to look at masm macro capibilities=masm manuals
http://doc.ddart.net/asm/Microsoft_MASM_Programmers_Guide_v6.1/Chap_09.htm
if you are interested in learn macros
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: hutch-- on March 23, 2005, 01:49:17 AM
Magnus,

I had a play with removing some of the ambiguous instructions and creating a macro that does both variations but I could not get it to work with REP. MOVSD is an example where you can detect the parameters which makes it an SSE instruction or without parameters its a string instruction and it worked by itself but not with REP.

I wonder if a macro with MOVS can do the job instead ?
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: daydreamer on March 26, 2005, 12:22:11 PM
Quote from: hutch-- on March 23, 2005, 01:49:17 AM
Magnus,

I had a play with removing some of the ambiguous instructions and creating a macro that does both variations but I could not get it to work with REP. MOVSD is an example where you can detect the parameters which makes it an SSE instruction or without parameters its a string instruction and it worked by itself but not with REP.

I wonder if a macro with MOVS can do the job instead ?
but do you really need REP MOVSD, when you choose to write SSE2 and includes the macros, when you have movdqa,movaps,movapd?

Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: AeroASM on April 22, 2005, 08:26:04 PM
How about just learning the opcode sequence for rep movsd and inserting it with db?
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: daydreamer on May 27, 2006, 05:33:23 PM
could we have this sticky, so they are not forgotten Hutch?
some SSE/SSE2 doc also heree


[attachment deleted by admin]
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: janexiao on August 26, 2006, 06:16:37 AM
有点晕
Title: Re: SSE2 macros for ML 6.14 by Daydreamer
Post by: Rockoon on February 04, 2007, 06:08:20 AM
Quote from: AeroASM on March 11, 2005, 07:51:25 PM
Also in SSE and beyond, movdqa, movaps and movapd all do the same thing, yet they all have different encodings. Why?

Because they do not necessarily "do the same thing" .. while current incarnations might perform the exact same work (I am not convinced), later on they may want to put in rounding control, floating point normalization, and other goodies on the floating point versions. In short, context may become important.

Use the one that addresses your datatype to avoid any nasty compatability issues in the future.