https://bugs.llvm.org/show_bug.cgi?id=43515

            Bug ID: 43515
           Summary: trunc(x >> (bitwidth-1)) ^ 1 is not recognized as
                    bt+setae
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: lebedev...@gmail.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

https://godbolt.org/z/jUiaJg

If we start with
int cmpge32_0(long a) {
  return a>=0;
}
We get
        shr     rax, 63
        xor     eax, 1

But for less canonical 
  %n0 = and i64 %x, 9223372036854775808 # sign bit mask
  %n1 = icmp eq i64 %n0, 0
  %r = zext i1 %n1 to i32 

we get seemingly-more-optimal
        xor     eax, eax
        bt      rdi, 63
        setae   al

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to