Closed y21 closed 6 months ago
I'm guessing the problem is this FIXME here?
Indeed. Fixing this is non-trivial as the logic to determine the final set of target features is split out between rustc and the LLVM in case of the LLVM backend. Getting everything to match with Cranelift is not that easy. I do intend to do it eventually and likely do some refactorings to rustc to simplify this, but other things have taken priority.
spin_loop has a #[cfg(target_arch = "x86_64")] (which evaluates to true) in which it executes an sse2 instruction
As it happens this intrinsic is not actually UB to execute without sse2. On x86 processors without sse2 support it decodes as a nop instruction. For many intrinsics it is indeed a problem to execute them when the cpu doesn't support it though.
Should be fixed now by unconditionally returning SSE2 as supported.
Running
RUSTFLAGS="-Zcodegen-backend=cranelift" cargo miri test
on the following test trips up Miri.I'm guessing the problem is this FIXME here? https://github.com/rust-lang/rustc_codegen_cranelift/blob/289a27403645d95922c353e0953954ba00ec70cf/src/lib.rs#L191-L193
spin_loop
has a#[cfg(target_arch = "x86_64")]
(which evaluates totrue
) in which it executes an sse2 instruction