pouët.net

Integer VS Fpu

category: general [glöplog]

Someone told me to start it here..

Start it yourself and then perhaps I might follow, I am busy right now.. (and don't feel like wasting time on Pouet today and the days before)

p.s. I am out of (scene)life these days. I have a new PC but still bored to mess with it. I almost started trying to continue learning coding for C64 for my first little release with some friends from a group, perhaps I can work a bit more tomorrow. However, I should be studying tomorrow and ReAct is close too. So,. I don't plan to waste my time (and money) for the moment, but just to open the thread. If nobody replies seriously, I might make my debut to integer later. Be worried..
added on the 2004-05-02 20:42:21 by Optimus Optimus
Shhhhhhhhhhhh.
added on the 2004-05-02 20:43:45 by Pete Pete
iiiiiiiiiiiit.
added on the 2004-05-02 20:45:10 by Optimus Optimus

You think that I don't know about what the shit I am talking about? Hahahaha!!!

I am just guessing and sometimes there is a reason behind it..

===========================

>integer routines VS floating point

Well,. I hate when people are saying "We don't need integer today because FPU is preety fast". It's too general. What does this mean? That I can write a simple 2d sprite game with floating point?!? I don't think it's faster..

It might be only faster or more convenient to do than fixed point perhaps or cases where you have to switch from floating point to integer and back many times. I don't really know, for I have not made some tests yet on my Athlon. But I think that everything has it's use..

For example, I believe that especially some 2d effects could be still done with integer much faster. When I watch some software demos in older machines and try to understand why are they going so slow, I can't think anything else rather than the fact that FPU was used on every simple routine (no matter if some can go shitty fast with integer for sure), just like taking the equations for the effects and using them as they are, porting them without trying to optimize anything. When it works (and smooth enough with modern computers), people are so happy and do not care. And then they say excuses like "Integer is slower than FPU today" while it depends on the case..

Of course, FPU is more suitable on 3d gfx, it's harder for me to figure out how to use pure integer on a 3d engine especially on a very big and detailed one (perhaps it's easier on a simple 3d object show) without fucking up with everything. I started coding a simple 3d dot object rotator and I am simply bored to mess with my code to make it work with pure integer (oneday I tried badly, the dots movement was so jerky and sometimes wrong :P). However it has been done on the past for sure (with object shows on 486 demos). TeXeL even claimed to have found ways to do raytracing with pure integer, pitty he hasn't released anything :(

Perhaps FPU is ok for 3d vector maths, to move/rotate vertices and stuff, which are not very much. Then a triangle rasterizer could be better done by integer. 2d effects can be easilly done with integer, precalculated tables of sines and fast. For example a 2d distorter, I just don't know however about a filtered one (The one at the Orange demo Ibiza Experience, looks really great, however I can finally watch it fast now!)

Today I can analyze when a demo runs slow, think of the effect and imagine what the coder might be doing wrong, in some cases. And I discover that thing: Coders using FPU (sometimes even SIN, SQRT and such stuff instead of making tables) where it should be avoided..

Actually I wanted to start with some FPU assembly (might be needed for 4kb OpenGL intros), but I hate the stack. I just don't know when I will find the mood to mess with it again and finally understand it :P

Mmm,. I shouldn't be writting that much...

Some more stuff now would be, I didn't want to blame anyone with these stuff rater than say my opinion, so Quisten and the others can do what they wish and I like that they choose what they love to code (Who knows,. even me with that Athlon 2600+ I have now at home, might be seduced to take the "not care" way :)

Also, thanks for that link of the fast 3d engine, I will check it now..

=====================

p.s. Doom was outputting 8bit but nobody cares anyways. 10 years ago I woke up..

p.p.s. This was a continuation of the beginning..

p.p.p.s. Shane is good. I like Shane and his weird writtings. Perhaps you won't see me on Pouet. Time is dead. Shane is a good follower of me. In any case, "All your oneliners are belong to Shane..". I might be not here, so something has to keep the place sauber..

Goodbye,. out of glo... eerr Euros!
added on the 2004-05-02 20:55:23 by Optimus Optimus
We had these integer vs float threads years ago, you're late.
added on the 2004-05-02 21:04:52 by ithaqua ithaqua
This is an easy one. Use whatever fits your needs best. NEEEXT!

..and for the record, you have any idea how much is 3 _billion_ fp ops per second? (this is what you can squeeze out from a copuple of year old machines) You can easily fill a high-res screen several times over and over again at full framerate in pure fp. Only thing that bogs it down is conversions.
added on the 2004-05-02 21:05:04 by 216 216
good luck for calculating square root with integer
added on the 2004-05-02 21:13:05 by Gargaj Gargaj
thank you optimus, thank you for letting me code the way i love to code. I know my prods are slow, but "dark dreams" was my first real demo.....so speed wasnt a big deal. With 9months c experience , speed is nothing, there is so much to learn :)
added on the 2004-05-02 21:36:45 by quisten quisten
gargaj: not really hard (and also not overly hard to come up with an efficient implementation), just annoying :)
added on the 2004-05-02 21:45:24 by ryg ryg
ryg: that's why i said "good luck" instead of "you can't" :)
some things are meant to be floating point anyway.
added on the 2004-05-02 21:56:24 by Gargaj Gargaj
and anyway
after "pixelshaders vs software rendering" and "integer vs fpu" i'm waiting for the 3rd part of the trilogy "screwdriver vs butter toast"
added on the 2004-05-02 21:57:21 by Gargaj Gargaj
maybe the 3rd part should be "hardware vs software" ;)
added on the 2004-05-02 21:59:43 by quisten quisten
direct3d vs opengl!!!
added on the 2004-05-02 22:16:37 by ithaqua ithaqua
pc vs mac!
added on the 2004-05-02 22:42:29 by ekoli ekoli
ryg: annoying, with worse precision (and dynamic range) and probably even slower as well, no?
added on the 2004-05-02 22:55:49 by Sesse Sesse
Another fine piece of Optimus' unintentional narrow view. Dude, if you're too stupid to figure out how the FPU stack works and can't think of other uses for floating point numbers than "transforming a few vertices", why don't you just give up on topics like these and trying to be smart in general? :)

Oh well :)







added on the 2004-05-02 23:35:04 by superplek superplek
sesse : yeah, just a bit slower... just a bit... :))))))
added on the 2004-05-02 23:40:52 by apricot apricot
Gargaj: thats what you have rsq-tables for. way faster than fsqrt, and even with a 256-entries-table you get enough precition for most practical purposes. But the dynamic range is what really is a bitch as sesse says. But then again, this is not usually what is the real bottleneck, so why bother? (unless ofcourse you develop an opengl-driver for a fpu-less embedded system, or something like that ;)
added on the 2004-05-03 00:11:12 by kusma kusma
..and even faster than that are hardware fp rsq tables available at least in 3dnow, SSE and Altivec. (ok the 3dnow one isn't necessarily faster than manual lookup as it does only one at a time..)
added on the 2004-05-03 00:32:05 by 216 216
KUSMA DONTS SUPPORT THEM BASTARDISESZED INSTRUCTIONSETS!!!!11
added on the 2004-05-03 00:42:44 by kusma kusma
I won't be using integer math, at least not on an 2GHz-Machine with 3DNow/SSE/whatever. fp is smoother, mostly faster and easier to write. IMHO.
But it depends on what you want to achieve.
...why am i replying anyway... ;-)
added on the 2004-05-03 03:23:27 by raer raer
>good luck for calculating square root with integer

I will precalculate some tables =)

>thank you optimus, thank you for letting me code the way i love to code.

Yes, yes, yes,. you rulezy,.. domn't listenb to me, I am writting mirles now!!! Quisten is my hero!!!!!!

And the others: Hold on your horses, I am gonna make some tests oneday and see and try to code the same effects on integer and FPU. FPU is also good for making effects in a small grid and then interpolating the results via MMX. MMX ruleyz I have to learn it!!!

And it was me who I did said that you can use whatever means your needs. Zbs,. go on make your blobs with FPU when I can do them shitty fast with additive sprites (and that was not the way I did it on my blobdistort201 because of size and because some people thoughts that these are not blobs while I have mathematicall proofs that it is just the same as the same is doing 3d with or without matrix or wolfenstein3d with 4 scrollers..)

At ReAct, NAGZ will be there and we will drink more than here. BWeare!@
added on the 2004-05-03 11:51:05 by Optimus Optimus
But until now, we've never seen you doing a single thing..

Quote:

12:47 < jar> what is he on about? :)


:))
added on the 2004-05-03 12:52:55 by superplek superplek
Optimus: I think the point you are missing is that floatingpoints usually is more precise and they are fuckin' fast nowadays. However they arent for every purpose. using them as counters etc is useless. Also, i would never trade away the comfort and precision of using floats in i.e grid nodes in a gridexpander to gain 2 more fps. but ofcourse the actual gridexpansion is done with mmx and all that shite... the two datatypes has different uses, and it becomes less and less reason to use integers everywhere.

Ever experienced an integer wraparound?
added on the 2004-05-03 12:53:35 by kusma kusma
That would require him to actually do something instead of ranting Kusma, so don't count on it (not even using a floating point..) :)
added on the 2004-05-03 12:58:20 by superplek superplek

login