News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

SSE VS FPU

Started by Farabi, February 27, 2012, 11:02:16 AM

Previous topic - Next topic

jj2007

Quote from: qWord on March 04, 2012, 12:42:48 PMI do not know why, but I got the impression that especially assembler programmers seems to be infested by the use-globals-as-much-as-possible pest  :bg

Even worse, some combine it with the use-threads-as-much-as-possible pest ::)

qWord

Quote from: jj2007 on March 04, 2012, 01:12:13 PM
Quote from: qWord on March 04, 2012, 12:42:48 PMI do not know why, but I got the impression that especially assembler programmers seems to be infested by the use-globals-as-much-as-possible pest  :bg

Even worse, some combine it with the use-threads-as-much-as-possible pest ::)
thread safety isn't the only advantage of locals  ::)
FPU in a trice: SmplMath
It's that simple!

dedndave

i think he's talking to me, qWord - lol
i use a thread whenever i need a synchronous function to be asynchronous   :bg
i am also probably guilty of using global vars too often
i usually stick things in global vars to start with, then clean them up and make them local, if it is appropriate
sometimes, i get lazy and don't do the clean-up

jj2007

Quote from: dedndave on March 04, 2012, 06:53:47 PM
i think he's talking to me, qWord - lol

Nope, Dave, that was a pure inner-German teasing :toothy
There is nothing wrong about locals, I also use them as much as appropriate. Or, to quote Einstein, I try to make everything as simple as possible but not simpler. There are moments when you need globals. There are moments when you need threads, but that's another story ::)

Farabi

i'll be home next day and try to make a complete procedure to compare it. currently im working on the capital city jakarta.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Greenhorn__

Sorry Sirs, I'm not familiar with all the SSE stuff.
Is there a little SSE tutorial out there ?

BTW, here are my results:

VertexTimings1
AMD FX(tm)-8150 Eight-Core Processor            (SSE4)
10 cycles for Vec_SubSSE
18 cycles for Vec_Sub
189 cycles for 100*fmul
30965 cycles for 100*mulsd

10 cycles for Vec_SubSSE
15 cycles for Vec_Sub
188 cycles for 100*fmul
31100 cycles for 100*mulsd


VertexTimings2
AMD FX(tm)-8150 Eight-Core Processor            (SSE4)
9 cycles for Vec_SubSSE
15 cycles for Vec_Sub
186 cycles for 100*fmul
30784 cycles for 100*mulsd movlps
145 cycles for 100*mulsd movsd

9 cycles for Vec_SubSSE
15 cycles for Vec_Sub
186 cycles for 100*fmul
30808 cycles for 100*mulsd movlps
145 cycles for 100*mulsd movsd


Regards
Greenhorn
You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time.
(Abraham Lincoln)

dedndave

there are a few out there - google   :P

here's one
http://www.tommesani.com/Docs.html

Greenhorn__

Thanks Dave.  :U
...And sorry for my laziness to google it by myself ...  :red


Regards
Greenhorn
You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time.
(Abraham Lincoln)

dedndave

i need to learn MMX and SSE, myself   :bg

Farabi


MulFPU proc a:real4,b:real4
LOCAL d:dword

fld a
fmul b
fistp d

ret
MulFPU endp

Mulx86 proc a:dword,b:dword

xor edx,edx
mov ecx,a
mov eax,b
mul ecx

ret
Mulx86 endp


Youre right, it has no different. x86 only 16 ms and FPU 29 ms, it has no difference.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

dedndave

no need to zero EDX for MUL   :P

also - i find that MUL seems to work better if you can put some unrelated instruction just before

        mov     ecx,a
        mov     eax,b
        xor     edx,edx
        mul     ecx

qWord

what is the sense of comparing a floating point operation with an integer operation?
FPU in a trice: SmplMath
It's that simple!

Farabi

Quote from: qWord on March 09, 2012, 01:41:23 PM
what is the sense of comparing a floating point operation with an integer operation?

For the graphic optimizer routine, I though it will be faster if we used integer than floating point, but I just saw if it was the same.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"