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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to