[llvm-bugs] [Bug 28484] New: [x86, SSE] recognize that pcmp produces bitmask results

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 9 08:22:25 PDT 2016


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

            Bug ID: 28484
           Summary: [x86, SSE] recognize that pcmp produces bitmask
                    results
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) {
  %cmp = icmp eq <4 x i32> %a, %b
  %zext = zext <4 x i1> %cmp to <4 x i32>  ; "wrong" extend for SSE
  ret <4 x i32> %zext
}

$ ./llc -o - boolvec2.ll
LCPI2_0:
    .long    1                       ## 0x1
    .long    1                       ## 0x1
    .long    1                       ## 0x1
    .long    1                       ## 0x1
...
    pcmpeqd    %xmm1, %xmm0
    pand    LCPI2_0(%rip), %xmm0   <--- load + logic
    retq

----------------------------------------------------------------------------

Instead of and'ing, we could shift right logical (psrld 31, %xmm0) and not need
to load the constant.

-- 
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/20160709/3b9cf25e/attachment.html>


More information about the llvm-bugs mailing list