logoalt Hacker News

NooneAtAll3today at 1:17 AM4 repliesview on HN

can it be rewritten to use fixed point arithmetic instead?


Replies

ndepoeltoday at 8:40 AM

Yes but also no. The problem with fixed point arithmetic is a lack of dynamic range compared to floating point. Floats are great at representing both large numbers with limited precision and small numbers with high precision, but with fixed point you have to make a choice based on which kind of number you're trying to represent. Meaning you need to use a mixture of 8.24, 16.16 and 24.8 fixed point types (and appropriate conversions) depending on the context of the calculations that you're doing.

It's possible to write a game engine with that limitation, but there's no easy natural conversion from Quake's judicious use of floats to a fully fixed-point codebase. You'd have to redesign and rewrite the entire engine from scratch, basically.

klodolphtoday at 2:20 AM

I want to look at this from a different perspective… a single-precision floating-point multiply is pretty simple, no? 24x24 bit multiply, which is about half as many gates as a 32x32 bit multiply.

Maybe I would prefer to rip out the integer multiplication unit first, before ripping out the FPU.

Narishmatoday at 1:21 AM

The PS1 doesn't an FPU but got a version of Quake 2, so it's possible. That said, it was somewhat different from the PC version, so it could be argued that it's not the same game.

show 1 reply
rasztoday at 6:01 AM

Sure, but then you need CPU that is twice as fast :). Playstation did it by pushing geometry calculations to GTE.