x86 Intrinsics
How to use x86 intrinsics in Mojo? Also I see in the documentation (https://docs.modular.com/mojo/stdlib/sys/intrinsics/llvm_intrinsic) on using llvm_intrinscs. Can someone please share some example on how they've used them. I'm trying to use it but getting error:
ERROR:
llvm_intrinsic | Modular Docs
llvmintrinsicintrin AnyRegType, hasside_effect: Bool = true -> $1
3 Replies
The return type should be
Float32 or something. You can find many examples of its use in the stdlib.The error is telling you that you are using runtime
var instead of compile time alias or parameter. So you can replace var with alias on your 3 inputs above or just write them into the function call. And as noted above, the return type is there so that the compile knows what type to assign to the return value. Everything must have a known type at compile time. So AnyType will not work.Thanks working now