Hello all,
Let me quickly explain the subject: "MMX help" would suggest that I've written someting using MMX... In this case, no... I really just need help in understanding MMX (pref. in simplistic terms).

I've done a search of the board and a search of the web and all I've come up with was a list of various mmx commands and sporadic use by a few members of this board in various "pixel fading" examples :)

Does anyone have a few simple examples on the use of mmx commands... I can't be any more clear than that seeing I have no clue how to use mmx within my programs)... But something i can learn by?

Sliver

ps. Holy crap its 5:08! Time to get to sleep
Posted on 2002-02-12 04:07:53 by Sliver
Hi,

MMX is a set of new instructions introduced by Intel for the pentium processor family. There are several instructions which can give you a performance boost for your apps.
Example 4 additions at the same time with saturation etc.

MMX uses 8 register MM0 .. MM7 which are mapped over the FPU stack :(
That way you cannot mix FPU and MMX instructions.
movq, punpcklbw, packuswb are powerfull MMX instructions. Get a doku from Intel or even AMD

here

Bye Miracle
Posted on 2002-02-12 05:12:47 by miracle
Afternoon, Sliver.

I had a look around google....

Have a look at http://www.lmn.pub.ro/~bytemare/hardware/mmx/ .

Don't forget to "right-click" and select "Save Target As..." over those pd links.

Cheers,
Scronty
Posted on 2002-02-12 05:52:21 by Scronty
There really are only a handful of instructions to MMX, so you can literally read about a couple of them and jump right in. MOVD, MOVQ are the first to know.

movd MM0,eax ; low DWORD of MM0 is EAX
movq MM0, ; 64 bits of MM0 are loaded from eight bytes at address EAX

Simple Example: Add 10 to an array of bytes.
AddTen PROC pArray:DWORD, iArray:DWORD


.data
mmxc000A dq 000A000A000A000Ah ; constant 10
.code

mov eax,pArray ; pointer to array
mov ecx,iArray ; length of array of words
movq MM0,mmxc000A ; ten to add to four words at a time
@@: movq MM1,[eax] ; load
paddw MM1,MM0 ; add 'w' means word size
movq [eax],MM1 ; store
sub ecx,4
jg @B
ret

AddTen ENDP
Okay, it's not very useful PROC, but that isn't the point. ;)

Standard MMX is very limited:
- no unsigned multiply of upper words
- no load to high DWORD
- no byte shift
- no ROR, ROL instructions
- no DIV

Yet, I'm still amazed at all that can be done with MMX!
Posted on 2002-02-12 08:05:10 by bitRAKE
http://www.intel.com/vtune/cbts/mmxintro/TRYFIRST/INDEX.HTM#s

The same tutor is downloadable in .exe form *somewhere* on intel's site..

Thomas
Posted on 2002-02-12 11:00:17 by Thomas
Posted on 2002-02-12 12:06:08 by bitRAKE