[llvm-bugs] [Bug 42118] New: Missed BLSR oportunity

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 3 11:32:34 PDT 2019


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

            Bug ID: 42118
           Summary: Missed BLSR oportunity
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

bool blsr_missed(unsigned x) {
    return x == (x & -x);
}

GCC -g0 -O3 -march=btver2
blsr_missed(unsigned int):
  blsr eax, edi
  sete al
  ret

Clang -g0 -O3 -march=btver2

blsr_missed(unsigned int):
  mov eax, edi
  neg eax
  andn eax, eax, edi
  sete al
  ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190603/fe466924/attachment.html>


More information about the llvm-bugs mailing list