huonw/simd

LLVM ERROR: Cannot select: intrinsic %llvm.x86.sse41.dpps

Opened this issue · 3 comments

Hey,

I tried to add _mm_dp_ps to x86::Sse41F32x4, I thought it would be pretty trivial.

However, building with:
RUSTFLAGS="-C target-feature=+sse4.1" cargo rustc

leaves me with:

LLVM ERROR: Cannot select: intrinsic %llvm.x86.sse41.dpps.

My CPU is supports SSE4.1.

I can see this intrinsic defined in rust/rust-lang, so I'm not sure where to start to try and fix this.

I've just tried to do the same thing and run into the same error (sorry for not being very helpful). I'm not familiar with this side of things, but I thought it might have something to do with that const int mask/flags parameter.

I get similar errors if I try to implement other intrinsics, like SSE4.2's cmpistri.

Ping @huonw

I'm by far not an expert on this but since this error comes out of LLVM, it could be that Rust generats code which LLVM doesn't understand. One thought is that adding the compiler flag -C target-cpu=native in addition to -C target-feature=+sse4.1 might help. Did you put your code somewhere public?

I ran into the same issue today and adding -C target-cpu=native -C target-feature=+sse4.1 did fix the issue for me.