Hi
for example, __builtin_rvv_vsseg5e8_v seems a Intrinsic function, where is it’s definition at clang/llvm? thanks
It’s autogenerated by clang/include/clang/Basic/riscv_vector.td
I believe that creates tools/clang/include/clang/Basic/riscv_vector_builtins.inc
in the build directory.
yes, at the riscv_vector_builtins.inc, have below two macro define:
#define RISCVV_BUILTIN(ID, TYPE, ATTRS) TARGET_BUILTIN(ID, TYPE, ATTRS, “zve32x”)
RISCVV_BUILTIN(__builtin_rvv_vsseg5e8_v,“”, “n”)
define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS)
Then can find BUILTINstrong text in the file llvm/clang/include/Basic/Builtins.def
, and can know the detail of the BUILTIN parameter.
but hope to know BUILTIN() detailed implement, thanks.
The implementation is also created by tablegen from riscv_vector.td. It’s in tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc which is included by clang/lib/CodeGen/CGBuiltin.cpp
The LLVM intrinsics are defined in llvm/include/llvm/IR/IntrinsicsRISCV.td
The mapping of intrinsics to instructions is mostly in llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
at riscv_vector_builtin_cg.inc, it will call api to create llvm IR(have llvm intrinsics ), later map the intrinsics IR to instructions ?