Time to demote Fixed point maths?
Neil Walker

Been having a minor discussion on allegro 5 with friends and it made me realise something:

Allegro 5 manual said:

The only advantage of fixed point math routines is that you don't require a floating point coprocessor to use them...but stopped being so useful with the coming of the Pentium class of processors [i.e. in the 90's]....Many embedded processors have no FPUs so fixed point maths can be useful there.

and they were right, what is the point in Allegro's limited fixed point routines? or rather, given they have very little benefit to almost everyone why not remove the bloat from the core library and make it an add-on. Or better still, given Allegro has dragged it's way into the 21st century, drop it all together?

Arthur Kalliokoski

I read somewhere on the wiki that the mobile processors could easily lack an FPU.

Neil Walker

Android uses soft-fpu emulation when presented with floating point maths - you don't have to explicitly exclude every other platform from using floating point by coding with fixed point.

Besides, it seems to me like it's a minor, little used thing that should be an add-on and to stop presenting it as a core item that people (new to) Allegro should be looking at.


I agree that it should be an addon.

stop presenting it as a core item

Where is that done? I just had to check the docs since I didn't even know those functions are in A5. They are completely disconnected from the rest of the API and nothing suggests that it's a good idea to use them.

Arthur Kalliokoski

Maybe instead of having it in the Contents, it could be buried in the Platform-specific section.

Peter Wang

In fact, they are used in the core (scanline_drawers.c) though just barely.

I don't think it's worthwhile to remove now, but moving the documentation further down the table of contents is okay. Or is this more to do with appearances?

Gideon Weems

Don't necessarily consider this a vote for keeping it in the main library, but I've always appreciated the simplistic beauty of fixed-point. There's something satisfying about being able to see 0's and 1's and knowing what they represent. Bit operations work well on fixed-point, as well.



Aside from the lookup tables for the trig functions, this can't be using up much space. How much compared to pulling in the libC math library?

Seriously, 1 sprite takes up more resources than these functions. What are we really talking about here?

I submit, that if you're app is so pressed for memory you need to drop fixed-point math, then I say you are EXACTLY the person who should be seriously considering fixed-point math.

It's beautiful for optimizing tight math loops where you need decimal precision
in you rendering code.

It's already part of 5.0 API.

Fixed point math was up saving me cycles last night! Where were you?
liquored up, and out trolling for anonymous sex! That's where.
YOU should be on trial, not fixed-point math.

Leave fixed-point math alone !!! >:(

The defense rests.

Thread #610742. Printed from Allegro.cc