Closed
Description
👋 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.