Suggestion: FFastMath intrinsics in stable

My usual question here is which optimizations you're hoping to actually get from things.

Notably, the full fast flag allows a bunch of things that can easily result in UB, and I've never seen a single program that uses -ffast-math in C++ that actually did the work to check that those cases can't happen, which seems sketchy at best.

Note that there's a portable SIMD working group aiming to give a rusty, cross-platform interface to SIMD, which may well end up being a common choice for mathy uses of SIMD.

Also we have freeze available in LLVM, now, so there are some possibilities have have opened up that didn't exist back in LLVM 6 or so. Something like raw nnan can't be exposed to safe rust, but we might be able to make a safe version that can freeze the result so that poison becomes just an unspecified value instead of being able to trigger UB.

(That's in addition to the options that have existed for a while like nsz and arcp and such that never produce poison, so could always be exposed safely.)

4 Likes