Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing avx2 intrinsics #1419

Open
lu-zero opened this issue Nov 8, 2023 · 9 comments
Open

missing avx2 intrinsics #1419

lu-zero opened this issue Nov 8, 2023 · 9 comments
Labels
A-core-arch Area: Necessary for full core::arch support

Comments

@lu-zero
Copy link

lu-zero commented Nov 8, 2023

Current rav1e master shows:

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.pabs.w; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.pmadd.wd; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psign.w; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psrlv.d.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.packssdw; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.gather.d.d.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx.cvtdq2.ps.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psllv.d.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psrav.d.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.sse2.packssdw.128; replacing with trap
@bjorn3
Copy link
Member

bjorn3 commented Nov 8, 2023

Some of these (but not all) should have been implemented by #1417 which hasn't landed on rustc nightly yet.

@bjorn3 bjorn3 added the A-core-arch Area: Necessary for full core::arch support label Nov 8, 2023
@lu-zero
Copy link
Author

lu-zero commented Nov 9, 2023

Yes :) I tested with the current master and the list is shorter:

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.pabs.w; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psign.w; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psrlv.d.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psllv.d.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.psrav.d.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx.cvtdq2.ps.256; replacing with trap

warning: unsupported x86 llvm intrinsic llvm.x86.avx2.gather.d.d.256; replacing with trap

@bjorn3
Copy link
Member

bjorn3 commented Nov 24, 2023

The gather intrinsics are now implemented on the even_more_simd_intrinsics branch.

@MrFoxPro
Copy link

I'm getting warning unsupported x86 llvm intrinsic llvm.x86.avx2.psllv.d.256; replacing with trap
and invocation of image-rs crate (avif encoder) results in crash:

trap at Instance { def: Item(DefId(2:15232 ~ core[a9f5]::core_arch::x86::avx2::_mm256_sllv_epi32)), args: [] } (_ZN4core9core_arch3x864avx217_mm256_sllv_epi3217h96c8b42e4aa5b850E): llvm.x86.avx2.psllv.d.256

@svix-jplatte
Copy link

svix-jplatte commented Apr 25, 2024

I don't see permd listed above, but this is the same issue right?

trap at Instance { def: Item(DefId(1:15384 ~ core[212b]::core_arch::x86::avx2::_mm256_permutevar8x32_epi32)), args: [] } (_ZN4core9core_arch3x864avx227_mm256_permutevar8x32_epi3217h294fc7d72ae002f8E): llvm.x86.avx2.permd

Would be nice if there was a codegen_backend cfg so I could conditionally ignore the test that triggers this.

@folkertdev
Copy link
Contributor

I just added permd in #1491 (cc @svix-jplatte)

that PR is also a good template for if someone wants to add other avx2 intrinsics. Cranelift does not support values that wide (currently, not sure if it ever will) so the implementation will have to kind of simulate what the instruction does.

@svix-jplatte
Copy link

For that to become available via rustup, this repo needs to be synced into https://github.com/rust-lang/rust again, right?

@bjorn3
Copy link
Member

bjorn3 commented May 13, 2024

Correct, I can do that later today.

@svix-jplatte
Copy link

svix-jplatte commented May 15, 2024

Thanks, yesterday's nightly has support! I'm now also running into a llvm.x86.avx2.psllv.d.256 trap like MrFoxPro with the other one fixed 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core-arch Area: Necessary for full core::arch support
Projects
None yet
Development

No branches or pull requests

5 participants