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
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
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:
>
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?
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
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
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.