I understand your point though. :) Unsafe needs a higher bar
-
-
Replying to @Brittain_Ben @pcwalton
Literally nothing in userspace but ffi and runtime core stuff like heap should use unsafe. There's no need. Anything else is just cutting corners for performance.
2 replies 0 retweets 1 like -
this is not true
1 reply 0 retweets 1 like -
It's moderately true for the most part depending on how you define "runtime"
1 reply 0 retweets 0 likes -
my userspace code uses unsafe to access _mm256_mul_epu32
1 reply 0 retweets 1 like -
Replying to @hdevalence @Brittain_Ben and
essentially all of core::arch (in particular, all of the AVX2 intrinsics) are marked unsafe, iirc because the compiler cannot determine that invoking them won’t cause SIGILL. it’s just not true that “Literally nothing in userspace ... should use unsafe. There's no need.”
2 replies 0 retweets 3 likes -
Intrinsics are poor substitutes for a decent compiler. I've never used them and they're clearly in the class of sidestepping safety for performance.
2 replies 0 retweets 1 like -
Replying to @RichFelker @hdevalence and
I use core::arch intrinsics to write Rust that LLVM lowers to the idealized assembly for the function I’m implementing, according to a former Intel employee and world-class cryptographer (well almost, I need to teach it a new intrinsic, which I understand I can do at lib level)
2 replies 0 retweets 1 like -
Replying to @bascule @RichFelker and
Do you have any PR on this new intrinsic I could follow? I'm wondering whether this is a feasible method/process to use some Cortex-M instruction (umaal).
1 reply 0 retweets 0 likes -
Replying to @nickraystalder @RichFelker and
Nope. This is the PR that added the one I’m using, but I want to combine 4 calls to that into one VPCLMULQDQhttps://github.com/rust-lang/stdarch/pull/320/files …
1 reply 0 retweets 1 like
My favorite x86 instruction just for the name
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.