[PATCH] D121915: [RISCV] CLZ Instruction
Craig Topper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 11 09:16:57 PDT 2022
craig.topper added inline comments.
================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:18910
+ case RISCV::BI__builtin_riscv_clz_32:
+ case RISCV::BI__builtin_riscv_clz_64:{
+ Function *F = CGM.getIntrinsic(Intrinsic::ctlz, Ops[0]->getType());
----------------
Add a space before the opening curly brace
================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:18913
+ return Builder.CreateCall(F, {Ops[0], Builder.getInt1(false)});
+ }
// Zbc
----------------
Fix the clang-format warning here
================
Comment at: clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb.c:21
+// RV32ZBB-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
+// RV32ZBB-NEXT: [[TMP1:%.*]] = call i32 @llvm.riscv.clz.i32(i32 [[TMP0]])
+// RV32ZBB-NEXT: ret i32 [[TMP1]]
----------------
There is no llvm.riscv.clz.i32 intrinsic. Was this test not updated?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121915/new/
https://reviews.llvm.org/D121915
More information about the cfe-commits
mailing list