playdate icon indicating copy to clipboard operation
playdate copied to clipboard

Floating point math operations optimisation

Open boozook opened this issue 1 year ago • 0 comments

Explicitly set floating point single precision for compiler.

Official recommendations:

The Cortex-M7 processor used in the Playdate has support for single precision floating point operations (ie. the float type), but not for double precision operations (ie. the double type).

Some compiler flags can be used to make these mistakes obvious or easier to deal with:

  • -Wdouble-promotion: Warns whenever a float is implicitly being converted to double.
  • -fsingle-precision-constant: All real constants will be float rather than double, ie. 1.0 will be the same as 1.0f.
  • [ ] implementation
  • [ ] tests for bins
  • [ ] tests for libs

boozook avatar Sep 15 '23 20:09 boozook