🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.basm
7 messages
7 total messages Started by ADS Wed, 04 Sep 2002 14:17
MMX instruction usefull?
#386
Author: ADS
Date: Wed, 04 Sep 2002 14:17
42 lines
1834 bytes
Hello,

I have to apply the some Mathematical function to 3 variables and I have
heard that with MMX we can do at the same time multiple functions :

Different cases :

here Value is an integer,

and CMY               : array[0..9] of cmsCMY;  where

 cmsCMY = packed record
    C, M, Y: Double
  end;

addition and multiplication

CMY[J].C := CMY[J].C + CMY[k].C * Value;
CMY[J].M := CMY[J].M + CMY[k].M * Value;
CMY[J].Y := CMY[J].Y + CMY[k].Y * Value;

division

CMY[J].C := CMY[k].C  /  Value;
CMY[J].M := CMY[k].M  /  Value;
CMY[J].Y := CMY[k].Y / Value;

multiplication

CMY[J].C := CMY[k].C  *  Value;
CMY[J].M := CMY[k].M  *  Value;
CMY[J].Y := CMY[k].Y * Value;


if the operation can be done in one step instead of three it could improve
speed a lot I think.

any idea?

thanks

Armindo
Re: MMX instruction usefull?
#390
Author: Andrew Rybenkov
Date: Wed, 04 Sep 2002 15:03
11 lines
1316 bytes
Not with MMX. For doubles you need SSE2 (PIII Tualatin or P4, (Tualatin is faster, btw)).
OTOH, for most of color manipulations singles are more than enough (IMHO).
So it would be SSE (any PIII and P4, naturally, too).

--
Andrew Rybenkov.

create labels, logos, image lists
for your programs and websites with
  "Imagizer: Click and Get It",
  http://www.geocities.com/arybenkov/imagizer/
Re: MMX instruction usefull?
#389
Author: Robert Lee
Date: Wed, 04 Sep 2002 15:14
19 lines
1426 bytes
ADS wrote:

> Hello,
>
> I have to apply the some Mathematical function to 3 variables and I have
> heard that with MMX we can do at the same time multiple functions :

>  cmsCMY = packed record
>     C, M, Y: Double
>   end;

MMX doesn't do floating point...and SSE and 3dNow can only do simultaneous
math on singles IIRC.  In short, you have to get all the way to SSE2 before
you can really do what you want to do.


--
Bob Lee
High Performance Delphi - http://www.optimalcode.com/
Re: MMX instruction usefull?
#392
Author: ADS
Date: Wed, 04 Sep 2002 15:26
8 lines
1112 bytes
Thanks Andrew and Robert for your reply,

So if I decide to do it in SSE and 3DNow, what would instruction should I
use?

thanks

Armindo
Re: MMX instruction usefull?
#391
Author: ADS
Date: Wed, 04 Sep 2002 15:26
9 lines
1194 bytes

>
> So if I decide to do it in SSE and 3DNow, what would instruction should I
> use?
>


in this case I will use singles of course
Re: MMX instruction usefull?
#393
Author: Guido Gybels
Date: Wed, 04 Sep 2002 17:23
17 lines
1534 bytes
"ADS" <nospam@wanadoo.fr> wrote in message
news:3d76260a@newsgroups.borland.com...
> So if I decide to do it in SSE and 3DNow, what would instruction should I
> use?

These are the SSE arithmetic instructions for addition, division,
multiplication and substraction:

ADD?S, DIV?S, MUL?S, SUB?S

Their SSE2 double equivalents are similar:

ADD?D, DIV?D, MUL?D, SUB?D

The ? is either P for packed doubles or S for the scalar version.

Guido
Re: MMX instruction usefull?
#51
Author: ADS
Date: Wed, 04 Sep 2002 17:46
16 lines
1439 bytes
Thanks Guido
>
> These are the SSE arithmetic instructions for addition, division,
> multiplication and substraction:
>
> ADD?S, DIV?S, MUL?S, SUB?S
>
> Their SSE2 double equivalents are similar:
>
> ADD?D, DIV?D, MUL?D, SUB?D
>
> The ? is either P for packed doubles or S for the scalar version.
>
> Guido
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads