reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse3 | FileCheck %s --check-prefix=SSE3
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=SSE41
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX-32
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=AVX-32
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=AVX-64

define <3 x i16> @zext_i8(<3 x i8>) {
; SSE3-LABEL: zext_i8:
; SSE3:       # %bb.0:
; SSE3-NEXT:    movzbl {{[0-9]+}}(%esp), %ecx
; SSE3-NEXT:    movzbl {{[0-9]+}}(%esp), %edx
; SSE3-NEXT:    movzbl {{[0-9]+}}(%esp), %eax
; SSE3-NEXT:    movd %eax, %xmm0
; SSE3-NEXT:    pinsrw $1, %edx, %xmm0
; SSE3-NEXT:    pinsrw $2, %ecx, %xmm0
; SSE3-NEXT:    movd %xmm0, %eax
; SSE3-NEXT:    # kill: def $ax killed $ax killed $eax
; SSE3-NEXT:    # kill: def $dx killed $dx killed $edx
; SSE3-NEXT:    # kill: def $cx killed $cx killed $ecx
; SSE3-NEXT:    retl
;
; SSE41-LABEL: zext_i8:
; SSE41:       # %bb.0:
; SSE41-NEXT:    movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
; SSE41-NEXT:    pinsrb $1, {{[0-9]+}}(%esp), %xmm0
; SSE41-NEXT:    pinsrb $2, {{[0-9]+}}(%esp), %xmm0
; SSE41-NEXT:    pmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
; SSE41-NEXT:    movd %xmm0, %eax
; SSE41-NEXT:    pextrw $1, %xmm0, %edx
; SSE41-NEXT:    pextrw $2, %xmm0, %ecx
; SSE41-NEXT:    # kill: def $ax killed $ax killed $eax
; SSE41-NEXT:    # kill: def $dx killed $dx killed $edx
; SSE41-NEXT:    # kill: def $cx killed $cx killed $ecx
; SSE41-NEXT:    retl
;
; AVX-32-LABEL: zext_i8:
; AVX-32:       # %bb.0:
; AVX-32-NEXT:    vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
; AVX-32-NEXT:    vpinsrb $1, {{[0-9]+}}(%esp), %xmm0, %xmm0
; AVX-32-NEXT:    vpinsrb $2, {{[0-9]+}}(%esp), %xmm0, %xmm0
; AVX-32-NEXT:    vpmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
; AVX-32-NEXT:    vmovd %xmm0, %eax
; AVX-32-NEXT:    vpextrw $1, %xmm0, %edx
; AVX-32-NEXT:    vpextrw $2, %xmm0, %ecx
; AVX-32-NEXT:    # kill: def $ax killed $ax killed $eax
; AVX-32-NEXT:    # kill: def $dx killed $dx killed $edx
; AVX-32-NEXT:    # kill: def $cx killed $cx killed $ecx
; AVX-32-NEXT:    retl
;
; AVX-64-LABEL: zext_i8:
; AVX-64:       # %bb.0:
; AVX-64-NEXT:    vmovd %edi, %xmm0
; AVX-64-NEXT:    vpinsrb $1, %esi, %xmm0, %xmm0
; AVX-64-NEXT:    vpinsrb $2, %edx, %xmm0, %xmm0
; AVX-64-NEXT:    vpmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
; AVX-64-NEXT:    vmovd %xmm0, %eax
; AVX-64-NEXT:    vpextrw $1, %xmm0, %edx
; AVX-64-NEXT:    vpextrw $2, %xmm0, %ecx
; AVX-64-NEXT:    # kill: def $ax killed $ax killed $eax
; AVX-64-NEXT:    # kill: def $dx killed $dx killed $edx
; AVX-64-NEXT:    # kill: def $cx killed $cx killed $ecx
; AVX-64-NEXT:    retq
  %2 = zext <3 x i8> %0 to <3 x i16>
  ret <3 x i16> %2
}

define <3 x i16> @sext_i8(<3 x i8>) {
; SSE3-LABEL: sext_i8:
; SSE3:       # %bb.0:
; SSE3-NEXT:    movl {{[0-9]+}}(%esp), %eax
; SSE3-NEXT:    shll $8, %eax
; SSE3-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; SSE3-NEXT:    shll $8, %ecx
; SSE3-NEXT:    movd %ecx, %xmm0
; SSE3-NEXT:    pinsrw $1, %eax, %xmm0
; SSE3-NEXT:    movl {{[0-9]+}}(%esp), %eax
; SSE3-NEXT:    shll $8, %eax
; SSE3-NEXT:    pinsrw $2, %eax, %xmm0
; SSE3-NEXT:    psraw $8, %xmm0
; SSE3-NEXT:    movd %xmm0, %eax
; SSE3-NEXT:    pextrw $1, %xmm0, %edx
; SSE3-NEXT:    pextrw $2, %xmm0, %ecx
; SSE3-NEXT:    # kill: def $ax killed $ax killed $eax
; SSE3-NEXT:    # kill: def $dx killed $dx killed $edx
; SSE3-NEXT:    # kill: def $cx killed $cx killed $ecx
; SSE3-NEXT:    retl
;
; SSE41-LABEL: sext_i8:
; SSE41:       # %bb.0:
; SSE41-NEXT:    movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
; SSE41-NEXT:    pinsrb $1, {{[0-9]+}}(%esp), %xmm0
; SSE41-NEXT:    pinsrb $2, {{[0-9]+}}(%esp), %xmm0
; SSE41-NEXT:    pmovsxbw %xmm0, %xmm0
; SSE41-NEXT:    movd %xmm0, %eax
; SSE41-NEXT:    pextrw $1, %xmm0, %edx
; SSE41-NEXT:    pextrw $2, %xmm0, %ecx
; SSE41-NEXT:    # kill: def $ax killed $ax killed $eax
; SSE41-NEXT:    # kill: def $dx killed $dx killed $edx
; SSE41-NEXT:    # kill: def $cx killed $cx killed $ecx
; SSE41-NEXT:    retl
;
; AVX-32-LABEL: sext_i8:
; AVX-32:       # %bb.0:
; AVX-32-NEXT:    vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
; AVX-32-NEXT:    vpinsrb $1, {{[0-9]+}}(%esp), %xmm0, %xmm0
; AVX-32-NEXT:    vpinsrb $2, {{[0-9]+}}(%esp), %xmm0, %xmm0
; AVX-32-NEXT:    vpmovsxbw %xmm0, %xmm0
; AVX-32-NEXT:    vmovd %xmm0, %eax
; AVX-32-NEXT:    vpextrw $1, %xmm0, %edx
; AVX-32-NEXT:    vpextrw $2, %xmm0, %ecx
; AVX-32-NEXT:    # kill: def $ax killed $ax killed $eax
; AVX-32-NEXT:    # kill: def $dx killed $dx killed $edx
; AVX-32-NEXT:    # kill: def $cx killed $cx killed $ecx
; AVX-32-NEXT:    retl
;
; AVX-64-LABEL: sext_i8:
; AVX-64:       # %bb.0:
; AVX-64-NEXT:    vmovd %edi, %xmm0
; AVX-64-NEXT:    vpinsrb $1, %esi, %xmm0, %xmm0
; AVX-64-NEXT:    vpinsrb $2, %edx, %xmm0, %xmm0
; AVX-64-NEXT:    vpmovsxbw %xmm0, %xmm0
; AVX-64-NEXT:    vmovd %xmm0, %eax
; AVX-64-NEXT:    vpextrw $1, %xmm0, %edx
; AVX-64-NEXT:    vpextrw $2, %xmm0, %ecx
; AVX-64-NEXT:    # kill: def $ax killed $ax killed $eax
; AVX-64-NEXT:    # kill: def $dx killed $dx killed $edx
; AVX-64-NEXT:    # kill: def $cx killed $cx killed $ecx
; AVX-64-NEXT:    retq
  %2 = sext <3 x i8> %0 to <3 x i16>
  ret <3 x i16> %2
}