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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unimplemented intrinsic _mm_clmulepi64_si128 #1415

Closed
afonso360 opened this issue Nov 4, 2023 · 3 comments 路 Fixed by #1417
Closed

Unimplemented intrinsic _mm_clmulepi64_si128 #1415

afonso360 opened this issue Nov 4, 2023 · 3 comments 路 Fixed by #1417
Labels
A-core-arch Area: Necessary for full core::arch support

Comments

@afonso360
Copy link
Contributor

afonso360 commented Nov 4, 2023

馃憢 Hey,

I tried to run simd-json with cranelift as a backend and the testsuite fails with the following error:

running 276 tests
trap at Instance { def: Item(DefId(2:14922 ~ core[53bd]::core_arch::x86::pclmulqdq::_mm_clmulepi64_si128)), args: [0_i32] } (_ZN4core9core_arch3x869pclmulqdq20_mm_clmulepi64_si12817h746cb06518f50faaE): llvm.x86.pclmulqdq
error: test failed, to rerun pass `--lib`

It looks like we are missing the _mm_clmulepi64_si128 intrinsic.

I'd like to give it a go at implementing this intrinsic but it looks like its complicated enough (pseudocode) that it would probably warrant a libcall equivalent. Do we have a way of defining our own functions that we could inject into the final binary in a similar way to libcall's?

I think it's possible to implement this entirely in cranelift, but It doesn't look like the best way to go about it.

I should also note that simd-json compiles and passes its testsuite cleanly when disabling runtime feature detection. So that is an option for anyone wanting to use this library.

@bjorn3 bjorn3 added the A-core-arch Area: Necessary for full core::arch support label Nov 7, 2023
@bjorn3
Copy link
Member

bjorn3 commented Nov 7, 2023

I'd like to give it a go at implementing this intrinsic but it looks like its complicated enough (pseudocode) that it would probably warrant a libcall equivalent. Do we have a way of defining our own functions that we could inject into the final binary in a similar way to libcall's?

We don't have a way to define libcalls. I've just been producing incredibly bloated code with all loops unrolled in the generated clif ir for simd intrinsics right now :)

@bjorn3
Copy link
Member

bjorn3 commented Nov 7, 2023

I'm currently implementing this.

@bjorn3
Copy link
Member

bjorn3 commented Nov 7, 2023

Done in #1417

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

Successfully merging a pull request may close this issue.

2 participants