[PATCH] D48600: [GISel]:Add Opcodes for CTLZ/CTTZ/CTPOP

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 12:10:56 PDT 2018


aditya_nandakumar added inline comments.


================
Comment at: include/llvm/Support/TargetOpcodes.def:470-471
+
+/// Same as above, undefined for zero inputs.
+HANDLE_TARGET_OPCODE(G_CTTZ_ZERO_UNDEF)
+
----------------
arsenm wrote:
> Should we really preserve this SelectionDAGism or just make the zero is undef bit be an immediate operand to the instruction like the intrinsic?
I think having two opcodes is explicit and is a little easier to work with - we don't usually have immediates in GISel instructions - and constants are encoded through a reg defining G_CONSTANT which makes it a little inconvenient to use. It probably also might make importing tablegen patterns slightly easier.
I'm okay with either way if someone has a strong enough opinion. 


Repository:
  rL LLVM

https://reviews.llvm.org/D48600





More information about the llvm-commits mailing list