ok, i'm experimenting with MMX and SSE

Started by OceanJeff32, October 14, 2005, 08:03:16 AM

Previous topic - Next topic

OceanJeff32

Ok, so I have visual C++ 6.0, as I don't like the visual studio 2005...

and I am trying to understand the SSE versus the MMX technologies.

The attached program is also following the Wrox Tutorial that ships with Visual c++. Anyways, I've tried to put the MMX array addition into SSE commands, but can't get it to work.

What do I do?

Don't I just switch the mm0 and mm1, to xmm0 and xmm1?

AND switch the MOVQ to MOVDQU?
AND switch the add esi, 8 to add esi, 16
AND half the number of iterations of the loop (howard the duck loop)

anyways, I tried that to no avail.  any help would be appreciated.

later,

jeff c
:U

[attachment deleted by admin]
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

OceanJeff32

I just read that other thread on impossible rotations.

Does this mean that my Visual c++ 6.0 standard, does not support SSE2 or SSE?

Hmm...we'll have to see about that?

Does Visual Studio 2005 if I have Beta 2 release?

I'm just experimenting with SSE and SSE2 especially the 128-bit SIMD integer instructions.

Later,

jeff c
:eek :dazzled:
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

bozo

This is the output i got for your program using MMX.

a1: 130 111 142 413 314 115 176 917
b1: 105 991 809 107 968 553 847 431

Oranges are not the only fruit...
- and we have 11 fruits in all.



     MMX *--* SSE *--* SSE2
*------------------------------*
     Technology Analysis
*------------------------------*
  and Experiments by Jeff C


MMX Extensions
SSE Extensions
SSE2 Extensions POWERHOUSE!!!!!
c1: 235 1102 951 520 1282 668 1023 1348


I changed the inline asm to this:

   _asm {
lea esi, dword ptr a1
lea edi, dword ptr b1
lea edx, dword ptr c1
mov ecx, 2
howard_the_duck:
movdqa xmm0, xmmword ptr [esi]
movdqa xmm1, xmmword ptr [edi]
paddd xmm0, xmm1
movdqa xmmword ptr [edx], xmm0
add esi, 16
        add edi, 16
add edx, 16
loop howard_the_duck
emms
   }


And the results came out same.

a1: 130 111 142 413 314 115 176 917
b1: 105 991 809 107 968 553 847 431

Oranges are not the only fruit...
- and we have 11 fruits in all.



     MMX *--* SSE *--* SSE2
*------------------------------*
     Technology Analysis
*------------------------------*
  and Experiments by Jeff C


MMX Extensions
SSE Extensions
SSE2 Extensions POWERHOUSE!!!!!
c1: 235 1102 951 520 1282 668 1023 1348


hope that helps. :thumbu

also, be sure to have service pack 5 installed if not already.

OceanJeff32

I'm doing some more experiments, one of which is to figure out which would be best, I have the following:

Visual Studio 6.0 Standard (actually purchased a while ago... still enjoy using)
Visual Studio C++.NET Introductory Edition (not full version, but compiles like full version, with copyright message before each program starts, came with book on graphics programming for Direct X)
VCToolkit (which I think I may be able to work with now that I've learned a bit more about C in the past few days...and it's FREE)
AND
Visual Studio 2005 Beta 2 (which I believe has everything Visual C++ , Visual Basic, and Visual Anything you can think of...??? and it's also FREE, I think I paid for shipping, I got a DVD)

I'm hoping to work with VCToolkit or Visual Studio 2005 beta 2, but these products are SO easy to work with, that they're hard to figure out, does that make sense???

:lol :eek :dazzled: :wink

Later,

Jeff C
:U

P.S. My biggest problem working with VCToolkit is the command-line compiling.  KILLER to figure out, this can be harder than programming! Am I wrong?  Anyways, I happen to notice yesterday that along with several other bizarre by-products of compiling, is an .htm file that shows the command line parameters and calls to the compiler, etc.  This is awesome!  Why don't they just say in the /h switch help file....um, use the IDE, and copy the command line from that...now go away....?? :boohoo:
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

OceanJeff32

Awesome, thanks Kernel!

I am using Visual Studio 2005 beta 2 release. BTW

Only I had to switch to MOVDQU (the DQA caused a program crash!)

Now I can implement a particle engine in my Win GDI breakout that I was working on, and using one array for X values, one for Y values, then separate arrays for X velocities, and Y velocities, and then PADDD them all together, if I use DWORDs, then 4 at a time (128-bits), versus if I switch to WORDs, then 8 at a time...cool? We shall see...

Thanks again.

Any ideas as to what these command line parameters do for cl.exe?

/MLd

/YX

Just Curious,

Jeff C
:U

P.S. One main reason I am staying with Visual Studio 2005 is because of the filesize (I couldn't upload the executable before it was HALF A MEG! with visual c++ 6.0...), I've included the executable in this file, as well as the source.

[attachment deleted by admin]
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

bozo

I would rather use Visual Studio 2005 too, but haven't been able to order a copy of the beta yet.
Just wondering are you running 64-bit version of windows?

I couldn't run the binary..but it still compiled fine in vc6, so all ok :)

no idea what the switches are for i'm afraid.

OceanJeff32

Oh, 64-bit Windows...nope.  I read that website you posted on here the other day, as long as my new computer lets me be creative with making my own programs, I'll buy it.  I'm going to wait a while until 64-bit truly takes over.  Has 32-bit taken over??  :lol

Anyways, yes, I guess I compiled a DEBUG version...sorry.

The release version of the file is even smaller!

Go figure..

later,

jeff c

P.S. The smaller executable and other files are attached.
:U

[attachment deleted by admin]
Any good programmer knows, every large and/or small job, is equally large, to the programmer!