The MASM Forum Archive 2004 to 2012
Welcome, Guest. Please login or register.
June 10, 2023, 03:58:31 PM

Login with username, password and session length
Search:     Advanced search
128553 Posts in 15254 Topics by 684 Members
Latest Member: mottt
* Home Help Search Login Register
+  The MASM Forum Archive 2004 to 2012
|-+  Project Support Forums
| |-+  MASM32
| | |-+  SSE2 macros for ML 6.14 by Daydreamer
« previous next »
Pages: [1] Print
Author Topic: SSE2 macros for ML 6.14 by Daydreamer  (Read 34843 times)
hutch--
Administrator
Member
*****
Posts: 12013


Mnemonic Driven API Grinder


SSE2 macros for ML 6.14 by Daydreamer
« 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]
Logged

Regards,



Download site for MASM32
http://www.masm32.com
Jimg
Member
*****
Posts: 1280


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #1 on: March 08, 2005, 11:22:06 PM »

I'm having a little trouble iincluding these macros.

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

After fixing that, it hates these two:

Code:
CMPLTSD MACRO M1,M2
    DB 0F2H
    CMPLTPS M1,M2
END
and
Code:
CMPSD 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.
« Last Edit: March 09, 2005, 01:21:56 AM by Jimg » Logged
daydreamer
Member
*****
Posts: 616


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #2 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]
« Last Edit: March 09, 2005, 07:29:51 AM by daydreamer » Logged
hutch--
Administrator
Member
*****
Posts: 12013


Mnemonic Driven API Grinder


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #3 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.
Logged

Regards,



Download site for MASM32
http://www.masm32.com
hutch--
Administrator
Member
*****
Posts: 12013


Mnemonic Driven API Grinder


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #4 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.
Logged

Regards,



Download site for MASM32
http://www.masm32.com
AeroASM
Guest


Email
Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #5 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?
Logged
daydreamer
Member
*****
Posts: 616


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #6 on: March 22, 2005, 06:19:53 PM »

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?
Logged
AeroASM
Guest


Email
Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #7 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
Logged
daydreamer
Member
*****
Posts: 616


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #8 on: March 22, 2005, 06:56:44 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
Logged
hutch--
Administrator
Member
*****
Posts: 12013


Mnemonic Driven API Grinder


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #9 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 ?
Logged

Regards,



Download site for MASM32
http://www.masm32.com
daydreamer
Member
*****
Posts: 616


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #10 on: March 26, 2005, 12:22:11 PM »

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?

 
Logged
AeroASM
Guest


Email
Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #11 on: April 22, 2005, 08:26:04 PM »

How about just learning the opcode sequence for rep movsd and inserting it with db?
Logged
daydreamer
Member
*****
Posts: 616


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #12 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]
Logged
janexiao
Guest


Email
Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #13 on: August 26, 2006, 06:16:37 AM »

有点晕
Logged
Rockoon
Member
*****
Gender: Male
Posts: 612


Re: SSE2 macros for ML 6.14 by Daydreamer
« Reply #14 on: February 04, 2007, 06:08:20 AM »

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.
Logged

When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum Archive 2004 to 2012 | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!