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
I don't know what instruments is, but you either need to enable `-C target-cpu=native` (or `-C target-feature=+avx2`) when compiling, or use dynamic CPU feature detection along with, e.g., `#[target_feature(enable = "avx2")]`. All of this should be explained in the docs.
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.