I want to @code_native a function, make some edits to the assembly and then run it.
@code_native
For example a function I want to edit is
using SIMD f(x, y) = any(x > y) x = Vec{8, Float32}(1) y = Vec{8, Float32}(0)
I would like some way to copy @code_native debuginfo=:none f(x, y) and then run it.
@code_native debuginfo=:none f(x, y)
You can llvmcall and use assembly, but you’d need to edit it. Alternatively, if it’s big enough that those modifications are unwieldy, you could compile into a shared library with gcc and ccall it.
llvmcall
ccall
Here is an example: VectorizationBase.jl/intrin_funcs.jl at 2842337a85aefc5e3352e1b6272589f4e53c58ee · JuliaSIMD/VectorizationBase.jl · GitHub See here for more details: LLVM Language Reference Manual — LLVM 17.0.0git documentation