[llvm-bugs] [Bug 30635] New: Improve *_EXTEND_VECTOR_INREG codegen for illegal types

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 7 07:52:59 PDT 2016


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

            Bug ID: 30635
           Summary: Improve *_EXTEND_VECTOR_INREG codegen for illegal
                    types
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org, mkuper at google.com,
                    pirama at google.com, spatel+llvm at rotateright.com
    Classification: Unclassified

https://reviews.llvm.org/D25268 fixed integer promotion but the codegen is
still pretty nasty - there is no need for us to vectorize in this case, we
should just call movzbl/movsbl load+ext:

define <3 x i16> @zext_i8(<3 x i8>) {
  %2 = zext <3 x i8> %0 to <3 x i16>
  ret <3 x i16> %2
}

zext_i8:
  vpxor        %xmm0, %xmm0, %xmm0
  vpinsrb    $0, 4(%esp), %xmm0, %xmm0
  vpinsrb    $4, 8(%esp), %xmm0, %xmm0
  vpinsrb    $8, 12(%esp), %xmm0, %xmm0
  vmovd        %xmm0, %eax
  vpextrw    $2, %xmm0, %edx
  vpextrw    $4, %xmm0, %ecx
  retl

define <3 x i16> @sext_i8(<3 x i8>) {
  %2 = sext <3 x i8> %0 to <3 x i16>
  ret <3 x i16> %2
}

sext_i8:
  vpinsrb    $0, 4(%esp), %xmm0, %xmm0
  vpinsrb    $4, 8(%esp), %xmm0, %xmm0
  vpinsrb    $8, 12(%esp), %xmm0, %xmm0
  vpslld    $24, %xmm0, %xmm0
  vpsrad    $24, %xmm0, %xmm0
  vmovd        %xmm0, %eax
  vpextrw    $2, %xmm0, %edx
  vpextrw    $4, %xmm0, %ecx
  retl

-- 
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/20161007/e21e5e8b/attachment.html>


More information about the llvm-bugs mailing list