craig.topper accepted this revision.
craig.topper added a comment.
This revision is now accepted and ready to land.
LGTM though I think the title needs to be updated. Should be something like
"[RISCV] Add clang builtins for CLZ instruction."
Repository:
rG LLVM Github Monorepo
CHANGES SINCE
joker881 updated this revision to Diff 422487.
joker881 added a comment.
upadated test files, fixed the format problem
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121915/new/
https://reviews.llvm.org/D121915
Files:
clang/include/clang/Basic/Bu
joker881 added a comment.
wait ,It seems the format problem have not solved,sorry
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121915/new/
https://reviews.llvm.org/D121915
___
cfe-commits mailing list
c
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 bef
joker881 updated this revision to Diff 421931.
joker881 added a comment.
Herald added subscribers: sunshaoce, StephenFan.
[RISCV]CLZ instruction
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121915/new/
https://reviews.llvm.org/D121915
Files:
cl
craig.topper added a comment.
Rethinking that. Since __builtin_clz is undefined for 0, I think we should have
clang builtins, but we should use llvm.ctlz with false for the second argument
as their implementation. See X86::BI__builtin_ia32_lzcnt_u32 for example.
Repository:
rG LLVM Github Mo
craig.topper added a comment.
These were intentionally not added because llvm has generic leading and
trailing zero builtins. __builtin_clz and __builtin_ctz
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121915/new/
https://reviews.llvm.org/D12191