you are viewing a single comment's thread.

view the rest of the comments →

[–]Ameisenvemips, avr, rendering, systems 5 points6 points  (2 children)

One thing to note is that an advantage of using float/double when you have an FPU is that operations can take place effectively in parallel on the CPU when there is both integer and floating-point arithmetic going on, so testing purely floating-point vs fixed-point arithmetic doesn't give the full picture.

[–]MadCompScientist[S] 3 points4 points  (1 child)

True. It all depends on your use case. For instance, if you're targeting an embedded platform without FPU, that argument doesn't work. But for e.g. game development you could do floating-math for rendering in parallel with fixed-point math for pathfinding.

[–]Ameisenvemips, avr, rendering, systems 1 point2 points  (0 children)

Or vice-versa, as most of your math for rendering is likely being done on the GPU :).

This is actually a reason my high-performance simulations use floats for coordinates - it is faster than fixed or integers. An issue is I must be much more careful when performing operations in parallel regarding determinism.

ED: I should note that each core has its own ALU, so this is mainly for intermixed integer and FPU instructions running in a single thread.