Head files are included in the second patch in case the name needs to be changed.
RV32 / 64:
orc.b
__builtin_riscv_orc_b_32 __builtin_riscv_orc_b_64 _rv_orc_b _rv32_orc_b _rv64_orc_b
Paths
| Differential D99320
[RISCV] [1/2] Add intrinsic for Zbb extension ClosedPublic Authored by LevyHsu on Mar 25 2021, 12:22 AM.
Details Summary Head files are included in the second patch in case the name needs to be changed. RV32 / 64: __builtin_riscv_orc_b_32 __builtin_riscv_orc_b_64 _rv_orc_b _rv32_orc_b _rv64_orc_b
Diff Detail
Event TimelineHerald added subscribers: vkmr, frasercrmck, evandro and 23 others. · View Herald TranscriptMar 25 2021, 12:22 AM Herald added subscribers: llvm-commits, cfe-commits, MaskRay. · View Herald TranscriptMar 25 2021, 12:22 AM Comment Actions
Comment Actions
craig.topper added a child revision: D99319: [RISCV] [2/2] Add intrinsic for Zbb extension.Mar 30 2021, 11:02 AM Comment Actions
Comment Actions Can I just check the reasoning on the naming? I see that the bitmanip 0.93 spec proposes _{rv,rv32,rv64}_{opname} intrinsics. Does the __builtin__{riscv,riscv32,riscv64}_opname format match what GCC are doing / planning to do here? Precedent for RVV, for other archs, or something else? Just trying to determine to what these names are an open item of discussion vs matching something else. EDIT: I see Craig commented on this point in https://reviews.llvm.org/D99009#2660456 Comment Actions
Yeah the big open for naming is the name of the intrinsic header. Whether it should be rvintrin.h or riscv_intrinsic.h. The builtins in this patch are builtin_riscv_orc_b_32 I've update the description summary to reflect this since it change during development. The Zbr patch uses the following without a 32/64 suffix. There's a difference because orc.b needs to be available for 32-bit on RV32 and RV64 per the spec so we have two builtins. crc32.b intrinsics in the spec are defined only for xlen so we have a single builtin. @kito-cheng do you know how gcc will name builtins? Comment Actions Created an issue for continue discuses on riscv-c-api-doc Comment Actions I'm going to approve this. If we need to change the builtin names in the future that's easy enough to do. This revision is now accepted and ready to land.Apr 1 2021, 11:00 PM This revision was landed with ongoing or failed builds.Apr 2 2021, 11:52 AM Closed by commit rG944adbf28550: Recommit "[RISCV] Add IR intrinsic for Zbb extension" (authored by LevyHsu, committed by craig.topper). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 335001 clang/include/clang/Basic/BuiltinsRISCV.def
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb.c
clang/test/CodeGen/RISCV/rvb-intrinsics/riscv64-zbb.c
llvm/include/llvm/IR/IntrinsicsRISCV.td
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/rv32zbb-intrinsic.ll
llvm/test/CodeGen/RISCV/rv64zbb-intrinsic.ll
|
Can we select between the 32 and 64 bit version in the header based on __riscv_xlen so we only need 2 builtins, rather than 3?