I've just been made aware that functions like this exist: https://github.com/rust-lang/stdarch/blob/abe96ca3b87fcca6aa1dfcefd40d8c8d92d2e673/crates/core_arch/src/x86_64/avx2.rs#L28-L34
#[rustc_args_required_const(1)]
// This intrinsic has no corresponding instruction.
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm256_extract_epi64(a: __m256i, imm8: i32) -> i64 {
let imm8 = (imm8 & 3) as u32;
simd_extract(a.as_i64x4(), imm8)
}
I was under the impression that #[rustc_args_required_const(...)] would be used primarily for intrinsics (including the behind-rustc's-back imported LLVM intrinsics), and maybe unstable implementation details.
At least right now I am uncomfortable letting #[rustc_args_required_const(...)] proliferate any further, and would much prefer any stabilized library-defined functions that rely on the attribute, to become true intrinsics.
Sadly, there are a few of them, so this won't be trivial.
cc @rust-lang/compiler
I've just been made aware that functions like this exist: https://github.com/rust-lang/stdarch/blob/abe96ca3b87fcca6aa1dfcefd40d8c8d92d2e673/crates/core_arch/src/x86_64/avx2.rs#L28-L34
I was under the impression that
#[rustc_args_required_const(...)]would be used primarily for intrinsics (including the behind-rustc's-back imported LLVM intrinsics), and maybe unstable implementation details.At least right now I am uncomfortable letting
#[rustc_args_required_const(...)]proliferate any further, and would much prefer any stabilized library-defined functions that rely on the attribute, to become true intrinsics.Sadly, there are a few of them, so this won't be trivial.
cc @rust-lang/compiler