Contributing to core::arch

There are some ARMv8 instructions that LLVM knows about, I think which are not presently exposed through core::arch::aarch64. I'd like to add them, but it seems like I'd probably need to define a new target_feature (the ARMv8 Cryptography Extensions), and I'm not sure how one gets started on a task like that.

Can anyone point me in the right direction?

The instructions in question are sha256h, sha256h2, and sha256su1.

1 Like

You just need to add the feature name here: rust/target_features.rs at master · rust-lang/rust · GitHub

If the Rust-exposed feature name is different from LLVM's then you'll need to adjust it here as well: rust/llvm_util.rs at master · rust-lang/rust · GitHub

I am quite confident that those intrinsics were previously exposed in core::arch::aarch64. Here is the relevant part of stdarch. This PR looks like a likely culprit behind the disappearance of those intrinsics. Try to open an issue in the stdarch repository?

1 Like

If I understand correctly, runtime target feature detection also has some bugs on ARM (noticed from a few experiments on raspberry pi)