Is Fixed point still better

Is Fixed point still better

Post by Phil Drinkwat » Sat, 26 Sep 1998 04:00:00



Quote:

>To toss in a couple more pennies, MMX does not add any registers,
>but instead makes use of the floating point registers.  The context
>switch between floating point and MMX instructions is very slow, so
>the two should be mixed as little as possible, if at all.

Just to add my tuppence worth..

Intel are bringing a new processor out which is like MMX but with
floating point, so you'll be able to do lots of floating point
operations in parallel. It also has new instructions for common
operations (eg. reciprocal I believe).

I would conpletely ditch fixed point if I were you - the chips are all
moving away from it as fast as they can!

Phil

 
 
 

Is Fixed point still better

Post by Jeff » Sat, 26 Sep 1998 04:00:00



> >To toss in a couple more pennies, MMX does not add any registers,
> >but instead makes use of the floating point registers.  The context
> >switch between floating point and MMX instructions is very slow, so
> >the two should be mixed as little as possible, if at all.

> Just to add my tuppence worth..

> Intel are bringing a new processor out which is like MMX but with
> floating point, so you'll be able to do lots of floating point
> operations in parallel. It also has new instructions for common
> operations (eg. reciprocal I believe).

> I would conpletely ditch fixed point if I were you - the chips are all
> moving away from it as fast as they can!

you mean like something AMD already has out (3dnow!) :>

the 3dnow! quake 2 kicks ass on my AMD K6-2 300

j

 
 
 

Is Fixed point still better

Post by Andrew Beat » Sun, 27 Sep 1998 04:00:00


On Thu, 24 Sep 1998 15:55:20 +0100, "James Sharman"


>Some cycle counts for floating point and integer on teh pentium.

>(int) ADD 1
>(float) FADD 1-3
>(int) DIV 17-41
>(float) FDIV 39
>(int) MUL 8-11
>(float) MUL 1-3

I was unable to easily find this information on the Intel developer
site. I'm wondering what the performance difference between 32bit
floats and 64bit (double) floats is and what conversion between them
costs,

thanks, Andrew.

 
 
 

Is Fixed point still better

Post by Gerry Qui » Sun, 27 Sep 1998 04:00:00



> I have a coule of books on 3d programming, most of which say that
>fixed point math is a good way to optimise any program (although none
>of them actually tell me how), But I heard that on a pentium floating
>point math is much faster, and the books are quite old. So, is it
>worth going to all the trouble of learning how to use fixed point
>math, or is it now redundant.

If all your calculations are going to be floating point, fixed point
will slow you down.  The Pentium has very fast floating point
operations.  Although integer addition and subtraction are much faster
than the floating point equivalents, the floating points more than
make up for it when it comes to multiplication and division.

However, if your calculated values will be used for table lookups,
fixed point still can be faster.  It all depends when you have to
convert to an int.

All output is ultimately in ints, eg. points on the screen or RGB
values.  So it's a judgement call.  In general, you don't need to
worry much about floating point inefficiency nowadays.

- Gerry

----------------------------------------------------------

----------------------------------------------------------

 
 
 

Is Fixed point still better

Post by Q » Sun, 27 Sep 1998 04:00:00



>On Thu, 24 Sep 1998 15:55:20 +0100, "James Sharman"

>>Some cycle counts for floating point and integer on teh pentium.

>>(int) ADD 1
>>(float) FADD 1-3
>>(int) DIV 17-41
>>(float) FDIV 39
>>(int) MUL 8-11
>>(float) MUL 1-3

>I was unable to easily find this information on the Intel developer site.

In one of the messages I've posted to this thread is the assembelr function
for obtaining exact number of cycles instructions can take;
for clear result you should call it with parameter size = 1 << (20...24) --
1-16 miilions
and then divide result on that number;
It works pretty good with integer instructions, but with FP you must be
careful not to overflow FPU stack and perform computations with valid
FP numbers (not a NaN's or others...)
(that was my mistake and because of it I posted incorrect figures for
FPU performance....  sorry )

Quote:>I'm wondering what the performance difference between 32bit
>floats and 64bit (double) floats is and what conversion between them
>costs,

You must be talking about C's float and double types. Well, I think
performance
penalty is only for storing twice as much data in case of doubles
(float is dword; double is two dwords and the long double is 10-byte);
The FPU internally works with 64-bit numbers (default), but can switched
to work with 53-bit or 24-bit accuracy, but the switching itself takes a
LOT of time and performance gain is zero.

CU

--

***> http://qdamage.webjump.com <*** Home site (some sources) ***

 
 
 

Is Fixed point still better

Post by Tal Lav » Sun, 27 Sep 1998 04:00:00




> > I have a coule of books on 3d programming, most of which say that
> >fixed point math is a good way to optimise any program (although none
> >of them actually tell me how), But I heard that on a pentium floating
> >point math is much faster, and the books are quite old. So, is it
> >worth going to all the trouble of learning how to use fixed point
> >math, or is it now redundant.

> If all your calculations are going to be floating point, fixed point
> will slow you down.  The Pentium has very fast floating point
> operations.  Although integer addition and subtraction are much faster
> than the floating point equivalents, the floating points more than
> make up for it when it comes to multiplication and division.

> However, if your calculated values will be used for table lookups,
> fixed point still can be faster.  It all depends when you have to
> convert to an int.

> All output is ultimately in ints, eg. points on the screen or RGB
> values.  So it's a judgement call.  In general, you don't need to
> worry much about floating point inefficiency nowadays.

> - Gerry

> ----------------------------------------------------------

> ----------------------------------------------------------

I know some Fixed point basics, and I use it in my nice little
RayCaster. Didn't seem to give much of a boost on my pentium.
My guess is that I don't use it as optimaly as I should. It's all got to
do to where to keep the floats and where to use fixed in order to keep
the minimum conversions needed.

Does anyone knows of a advanced fixed point reference(preferably
online)?

 
 
 

Is Fixed point still better

Post by Andrew Beat » Tue, 29 Sep 1998 04:00:00





>>I'm wondering what the performance difference between 32bit
>>floats and 64bit (double) floats is and what conversion between them
>>costs,

>You must be talking about C's float and double types. Well, I think
>performance
>penalty is only for storing twice as much data in case of doubles
>(float is dword; double is two dwords and the long double is 10-byte);
>The FPU internally works with 64-bit numbers (default), but can switched
>to work with 53-bit or 24-bit accuracy, but the switching itself takes a
>LOT of time and performance gain is zero.

Yes, I'm referring to C types, but they mirror the underlying
architecture of the machine. If I understand your answer correctly
then, fpu operations with 32 bit and 64 bit numbers take the SAME
number of clock cycles, memory latencies aside. There is no
zero-padding for 32 bit that has to be done or anything like that ?

thanks, Andrew.

PS. I'd RTFM but I'm not an assembler code expert and have no time to
become one.

 
 
 

Is Fixed point still better

Post by Sean Ell » Tue, 29 Sep 1998 04:00:00



>[...]
>>>(float) FDIV 39 [clocks]
>[...]
>The FPU internally works with 64-bit numbers (default), but can switched
>to work with 53-bit or 24-bit accuracy, but the switching itself takes a
>LOT of time and performance gain is zero.

The performance gain is not zero - it is quite considerable, but only
for divides. Switching to 24-bit precision takes the FDIV clock count
down by over 50% to a basic 19 cc's (53 bits of precision isn't
anywhere near as great, giving a modest saving of 6 cc's to 33).

If you have a lot of stuff to do in a tight loop, this could easily be
worth the extra penalty. In addition, FLDCW and FSTCW are not *so*
horrifically slow, at 7 and 2 cc's respectively, so even taking into
account the necessity to store and restore the state, that's only
around 2+7+7 = 16 cc's (plus penalties). This is less than the time
you save on even a single divide.

Sean

|||||||| 012345678 Proportiometer(TM)

 
 
 

Is Fixed point still better

Post by Q » Tue, 29 Sep 1998 04:00:00



>The performance gain is not zero - it is quite considerable, but only

[...skipped...]

Wow !! c00l !!  really !!   :)))
dammit, why didnt I know that earlier ??
thanks !!!

--

***> http://qdamage.webjump.com <*** Home site (some sources) ***