[PATCH] D116994: [RISCV] Add bfp and bfpw intrinsic in zbf extension

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 00:01:48 PST 2022


craig.topper added inline comments.


================
Comment at: clang/include/clang/Basic/BuiltinsRISCV.def:36
 
+// zbf extension
+TARGET_BUILTIN(__builtin_riscv_bfp, "LiLiLi", "nc", "experimental-zbf")
----------------
Capital Z


================
Comment at: clang/include/clang/Basic/BuiltinsRISCV.def:37
+// zbf extension
+TARGET_BUILTIN(__builtin_riscv_bfp, "LiLiLi", "nc", "experimental-zbf")
+TARGET_BUILTIN(__builtin_riscv_bfpw, "WiWiWi", "nc", "experimental-zbf,64bit")
----------------
I think we should have `__builtin_riscv_bfp_32` and `__builtin_riscv_bfp_64`. It's more convenient and portable for software to be written in terms of number of bits being operated on rather than changing behavior based on xlen.


================
Comment at: llvm/include/llvm/IR/IntrinsicsRISCV.td:98
+  def int_riscv_bfp  : BitManipGPRGPRIntrinsics;
+  def int_riscv_bfpw : BitManipGPRGPRIntrinsics;
+
----------------
We only need one intrinsic. `BitManipGPRGPRIntrinsics` is type overloaded. We can check the type in isel patterns.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116994/new/

https://reviews.llvm.org/D116994



More information about the llvm-commits mailing list