I think so. Following the advice about the input argument type, I wrote:
using SIMD
function rsqrt(f)
Base.llvmcall(("declare <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float>) nounwind readnone", "
%2 = call <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float> %0)
ret <4 x float> %2"), Vec{4, Float32}, Tuple{NTuple{4, VecElement{Float32}},},
(VecElement(f[1]),VecElement(f[2]),VecElement(f[3]),VecElement(f[4])))
end
Then I get
julia> rsqrt(Vec(Float32(1),Float32(1),Float32(1),Float32(1)))
ERROR: Module IR does not contain specified entry function
The documentation of llvmcall
says that if the first argument is a tuple, then its second member must be “a string representing the name of the entry-point function to call”. In the example, this doesn’t seem to be the case.