Open
Description
I tried this code:
#![no_std]
use core::arch::x86_64::*;
pub unsafe fn func() -> __m128i {
_mm_cvttps_epi32(_mm_setzero_ps())
}
It builds fine on x86_64-unknown-linux-gnu, but fails on x86_64-unknown-none:
rustc-LLVM ERROR: Do not know how to split the result of this operator!
Adding #[target_feature(enable = "sse2")]
or using -C target-feature=+sse2
does not prevent the error.
Meta
rustc --version --verbose
:
rustc 1.85.0-nightly (7442931d4 2024-11-30)
binary: rustc
commit-hash: 7442931d49b199ad0a1cc0f8ca54e327b5139b66
commit-date: 2024-11-30
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.4
Activity
hanna-kruppe commentedon Dec 1, 2024
It seems that target doesn't enable the SSE2 target feature, which is required for this intrinsic, by default. According to the target documentation this is intentional:
eduardosm commentedon Dec 1, 2024
Still fails after adding
#[target_feature(enable = "sse2")]
tofunc
or passing-C target-feature=+sse2
.