[PATCH] D157510: [RISCV] Implement intrinsics for XCVbitmanip extension in CV32E40P

Funan Zeng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 13 20:39:18 PDT 2023


melonedo marked 6 inline comments as done.
melonedo added a comment.

In D157510#4573494 <https://reviews.llvm.org/D157510#4573494>, @craig.topper wrote:

> Is there intended to be a header file that wraps the builtins? For other targets, builtins are considered an internal implementation detail and the real interface is the header file.  I'm trying to get a C interface approved for Zb* and Zk* standard extenions https://github.com/riscv-non-isa/riscv-c-api-doc/pull/44

Discussions for this question are being hosted under https://github.com/openhwgroup/corev-llvm-project/issues/74. Before we reach a conclusion, I will implement these intrinsics in both versions, i.e., both llvm.ctpop and llvm.riscv.cv.bitmanip.cnt.



================
Comment at: llvm/include/llvm/IR/IntrinsicsRISCVXCV.td:38
+
+    def int_riscv_cv_bitmanip_bitrev
+    : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
----------------
craig.topper wrote:
> Can we use llvm.bitreverse?
cv.bitreverse is a generalization of llvm.bitreverse, which allows specifying number of higher bits to be ignored and number of bits grouped togather. For example, cv.bitreverse t0, t0, 23, 2 can transform octal 001 010 011 to 01 010 001.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157510



More information about the llvm-commits mailing list