Commit Graph

4 Commits

Author SHA1 Message Date
Andrew Tridgell 13a2367278 AP_Math: change optimisation from -O3 to -O2 2019-09-28 08:57:26 +10:00
Peter Barker ce53ae63ae AP_Math: use /2 in place of *0.5f
MdB says:

dividing by 2 is actually optimal. It's type correct for all usage, and the compiler generates the multiplication if it's float, and sticks with divide for integers

Godbolt indicates on any optimization level (O1-O3, and Os) that the compiler will correctly optimize the / 2 into a float multiplication if using a float, but if using integer types in the template it will stick with the / 2 which is faster then doing the conversions to/from float.
2019-04-05 23:04:17 -07:00
Peter Barker 39ae285a7f AP_Math: add floating point constant designators 2019-04-05 23:04:17 -07:00
Andrey Kolobov a1fa2a9de3 AP_Math: added matrixN for soaring controller 2017-03-14 08:35:44 +11:00