https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78037

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #15)
> The problem is that we have no way to macroize (const_int {16,32,64}) in the
> pattern, and it would cause pattern explosion by writing out all define_insn

Why?  Just use const_int_operand, and in the condition verify that INTVAL is
equal to <MODE_SIZE> * 8.  Then add a small define_expand that
doesn't contain any pattern, just gen_tzcnt_1 (operands[0], operands[1],
GEN_INT (<MODE_SIZE> * 8));

> RTXes. So, I'd rather stay with UNSPEC and do constant folding in
> ix86_fold_builtin.

Reply via email to