[Bug target/78037] Incorrect code generated at optimization level -O2 for tzcnt and binary and

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 20 11:40:00 GMT 2016


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

--- Comment #18 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jakub Jelinek from comment #16)
> (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));

There are several functions that loop through recog_data.n_operands (e.g.
ix86_attr_lenght_immediate_default) that are confused by extra operands. This
is the reason we still keep *<s>muldi3_highpart_1 and *<s>mulsi3_highpart_1
separate, among others. I remember opening a PR about ability to macroize
constant values inside RTX years ago.


More information about the Gcc-bugs mailing list