[Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1

2021-08-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82259 --- Comment #7 from Andrew Pinski --- Created attachment 51248 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51248=edit patch for the eq issue This is the patch for the eq issue

[Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1

2021-08-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82259 --- Comment #6 from Andrew Pinski --- (In reply to Uroš Bizjak from comment #2) > A couple of *scc_bt patterns are missing. These are similar to already > existing *jcc_bt patterns. Combine wants: > > Failed to match this instruction: > (set

[Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1

2017-09-20 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82259 --- Comment #5 from Uroš Bizjak --- (In reply to Peter Cordes from comment #4) > (In reply to Uroš Bizjak from comment #2) > > A couple of *scc_bt patterns are missing. These are similar to already > > existing *jcc_bt patterns. Combine wants: >

[Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1

2017-09-19 Thread peter at cordes dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82259 --- Comment #4 from Peter Cordes --- (In reply to Uroš Bizjak from comment #2) > A couple of *scc_bt patterns are missing. These are similar to already > existing *jcc_bt patterns. Combine wants: Does gcc also need patterns for bt + cmovcc?

[Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1

2017-09-19 Thread peter at cordes dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82259 --- Comment #3 from Peter Cordes --- Oops, BT sets CF, not ZF. So bt $13, %edi setnc %al# aka setae ret This is what clang does for the bt_ functions, and might be optimal for many use-cases. (For

[Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1

2017-09-19 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82259 --- Comment #2 from Uroš Bizjak --- (In reply to Peter Cordes from comment #0) > Related: > > bool bt_unsigned(unsigned x, unsigned bit) { > //bit = 13; > return !(x & (1< } > > movl

[Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1

2017-09-19 Thread peter at cordes dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82259 --- Comment #1 from Peter Cordes --- More generally, you can flip a higher bit while copying with lea 64(%rdi), %eax That leaves the bits above that position munged by carry-out, but that isn't always a problem.