3 ms·
> Always enable fast-math unless your application has a demonstrable need for deterministically consistent floating point math. As far as I remember fast math
by josefx 5y ago
> Always enable fast-math unless your application has a demonstrable need for deterministically consistent floating point math.
As far as I remember fast math also breaks things like NaN and infinity, which makes filtering out invalid values before they hit something important fun since they will obviously still exist and mess up your results but you can no longer check for them.
- nickelpro 5y agoNo tight rendering loop building a transform matrix to ship off to the a graphics card has an isnan() in it to begin with. If your code cares about isnan() or infinities, that would be an example of a demonstrable need to not use fast-math
- deleted 5y ago[deleted]
- usefulcat 5y agoIf the compiler is going to assume that all FP values and calculations are finite, then you really need to be able to check for any non-finite input values, which you can’t do with -ffast-math because it silently breaks isnan and isinf. WTF. Also, there are other uses of FP besides games..