[llvm-bugs] [Bug 43194] New: [Hexagon] missed opportunity to use 'tstbit' instruction

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 2 07:35:10 PDT 2019


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

            Bug ID: 43194
           Summary: [Hexagon] missed opportunity to use 'tstbit'
                    instruction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: Hexagon
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org

define i32 @is_bit_clear(i32 %x) {
  %sh = lshr i32 %x, 10
  %a = and i32 %sh, 1
  %r = xor i32 %a, 1
  ret i32 %r
}

$ llc -mtriple=hexagon-- bitclear.ll -o -
is_bit_clear:   
        {
                r0 = and(r0,##1024)
        }
        {
                r0 = cmp.eq(r0,#0)
                jumpr r31
        }

https://godbolt.org/z/Zht4_4

See also discussion here:
https://reviews.llvm.org/D66687

-- 
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/20190902/62d6ce04/attachment.html>


More information about the llvm-bugs mailing list