4 ms·
And even if you do know what it does, it’s very impractical given that it’s a global option. Turning it on for selected portions of code would be a completely d
by SassyBird 2y ago
And even if you do know what it does, it’s very impractical given that it’s a global option. Turning it on for selected portions of code would be a completely different game.
- adgjlsfhk1 2y agoJulia has this (via a @fastmath macro) and it's so nice!
- swatcoder 2y agoYou're mistaken. You can/would just use it in the translation units where you want it; usually for numerical code where you want certain optimizations or behaviors and know that the tradeoffs are irrelevant. It's mostly harmless for everday application math anyway, and so enabling it for your whole application isn't a catastrophe, but it's not what people who know what they're doing would usually do. It's usually used for a specific file or perhaps a specific support library.
- leni536 2y ago-ffast-math affects other translation units too, because it introduces a global initialization that affects some CPU flags. You can't really contain it to a single TU.
- senkora 2y agoIt seems like this depends on whether you specify -ffast-math when linking or only when compiling: https://stackoverflow.com/a/68938551 https://stackoverflow.com/a/68938551 My understanding is that if you don't specify -ffast-math when linking then you shouldn't get crtfastmath.o linked in.
- adgjlsfhk1 2y agoso this is complicated by the fact that GCC has a bug until last year where it would set the subnormal truncation flag when it wasn't supposed to.