# Using LLVM intrinsic functions inside \`llvmcall\`

**URL:** https://discourse.julialang.org/t/using-llvm-intrinsic-functions-inside-llvmcall/87955
**Category:** Performance
**Tags:** llvm
**Created:** [September 28, 2022, 10:11pm UTC](https://discourse.julialang.org/t/using-llvm-intrinsic-functions-inside-llvmcall/87955 "2022-09-28T22:11:29Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![matthias314](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@matthias314](https://discourse.julialang.org/u/matthias314)
#### Post date: [September 28, 2022, 10:36pm UTC](https://discourse.julialang.org/t/using-llvm-intrinsic-functions-inside-llvmcall/87955/3 "2022-09-28T22:36:59Z")

</div>

I think so. Following the [advice](https://discourse.julialang.org/t/debugging-float-simd-intrinsics-via-llvmcall/27855/4) about the input argument type, I wrote:

```julia
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
julia> rsqrt(Vec(Float32(1),Float32(1),Float32(1),Float32(1)))
ERROR: Module IR does not contain specified entry function

```

The [documentation](https://docs.julialang.org/en/v1/base/c/#Core.Intrinsics.llvmcall) 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.

---

_[View the full topic](https://discourse.julialang.org/t/using-llvm-intrinsic-functions-inside-llvmcall/87955)._
