So I’m a bit baffled by some @rustlang SIMD behaviour, it seems that for some intrinsics (_mm_maddubs_epi16 for example) rust calls a function that isn’t inline instead if calling the relating instruction directly. Anyone has an idea what causes that? - https://rust.godbolt.org/z/mjJ5PM
-
Show this thread
-
Replying to @heinz_gies @rustlang
I found similar behavior when the SIMD code wasn't properly guarded with the appropriate `#[cfg(..)]`s. See https://llogiq.github.io/2018/09/19/simd-footguns.html …
1 reply 0 retweets 2 likes -
Thanks! I’ll give that a shot. I’d never have thought about that.
2 replies 0 retweets 1 like -
The docs here should explain stuff, including safety details and how to do dynamic CPU feature detection: https://doc.rust-lang.org/core/arch/index.html …
2 replies 0 retweets 4 likes -
That’s a good read! Interestingly enough if I throw the code in instruments (aka dtrace) it still seems to call functions the avx and avx2 functions :(
3 replies 0 retweets 1 like
When the functions aren't inlined, it means the compiler can't prove that the containing function is being compiled with the correct instruction set extensions (like AVX2). Therefore, the AVX function ABI can't be used, and thus, inlining is prevented to avoid undefined behavior.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.