[PATCH] D121915: [RISCV] CLZ Instruction

2022-04-13 Thread Craig Topper via Phabricator via cfe-commits
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

[PATCH] D121915: [RISCV] CLZ Instruction

2022-04-13 Thread Chang Hu via Phabricator via cfe-commits
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

[PATCH] D121915: [RISCV] CLZ Instruction

2022-04-13 Thread Chang Hu via Phabricator via cfe-commits
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

[PATCH] D121915: [RISCV] CLZ Instruction

2022-04-11 Thread Craig Topper via Phabricator via cfe-commits
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

[PATCH] D121915: [RISCV] CLZ Instruction

2022-04-11 Thread Chang Hu via Phabricator via cfe-commits
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

[PATCH] D121915: [RISCV] CLZ Instruction

2022-03-17 Thread Craig Topper via Phabricator via cfe-commits
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

[PATCH] D121915: [RISCV] CLZ Instruction

2022-03-17 Thread Craig Topper via Phabricator via cfe-commits
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