2016-10-07 05:27:05 +08:00
|
|
|
; 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
|
2016-10-07 22:42:22 +08:00
|
|
|
; 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
|
2016-10-07 05:27:05 +08:00
|
|
|
|
|
|
|
define <3 x i16> @zext_i8(<3 x i8>) {
|
|
|
|
; SSE3-LABEL: zext_i8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; SSE3: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %eax
|
2018-05-02 03:26:15 +08:00
|
|
|
; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %edx
|
2019-08-16 02:58:25 +08:00
|
|
|
; SSE3-NEXT: movd %edx, %xmm0
|
|
|
|
; SSE3-NEXT: pinsrw $1, %ecx, %xmm0
|
|
|
|
; SSE3-NEXT: pinsrw $2, %eax, %xmm0
|
2016-10-07 05:27:05 +08:00
|
|
|
; SSE3-NEXT: retl
|
|
|
|
;
|
|
|
|
; SSE41-LABEL: zext_i8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; SSE41: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; SSE41-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE41-NEXT: pinsrb $0, {{[0-9]+}}(%esp), %xmm0
|
2019-08-08 00:24:26 +08:00
|
|
|
; SSE41-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm0
|
2019-08-16 02:58:25 +08:00
|
|
|
; SSE41-NEXT: pinsrb $4, {{[0-9]+}}(%esp), %xmm0
|
2016-10-07 05:27:05 +08:00
|
|
|
; SSE41-NEXT: retl
|
|
|
|
;
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-32-LABEL: zext_i8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX-32: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; AVX-32-NEXT: vpxor %xmm0, %xmm0, %xmm0
|
|
|
|
; AVX-32-NEXT: vpinsrb $0, {{[0-9]+}}(%esp), %xmm0, %xmm0
|
2019-08-08 00:24:26 +08:00
|
|
|
; AVX-32-NEXT: vpinsrb $2, {{[0-9]+}}(%esp), %xmm0, %xmm0
|
2019-08-16 02:58:25 +08:00
|
|
|
; AVX-32-NEXT: vpinsrb $4, {{[0-9]+}}(%esp), %xmm0, %xmm0
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-32-NEXT: retl
|
2016-10-07 05:27:05 +08:00
|
|
|
;
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-64-LABEL: zext_i8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX-64: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; AVX-64-NEXT: vpxor %xmm0, %xmm0, %xmm0
|
|
|
|
; AVX-64-NEXT: vpinsrb $0, %edi, %xmm0, %xmm0
|
|
|
|
; AVX-64-NEXT: vpinsrb $2, %esi, %xmm0, %xmm0
|
|
|
|
; AVX-64-NEXT: vpinsrb $4, %edx, %xmm0, %xmm0
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-64-NEXT: retq
|
2016-10-07 05:27:05 +08:00
|
|
|
%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:
|
2017-12-05 01:18:51 +08:00
|
|
|
; SSE3: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; SSE3-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
|
|
|
; SSE3-NEXT: movd %eax, %xmm0
|
|
|
|
; SSE3-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
2019-06-27 04:16:19 +08:00
|
|
|
; SSE3-NEXT: pinsrw $1, %eax, %xmm0
|
2019-08-16 02:58:25 +08:00
|
|
|
; SSE3-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
2016-10-07 05:27:05 +08:00
|
|
|
; SSE3-NEXT: pinsrw $2, %eax, %xmm0
|
|
|
|
; SSE3-NEXT: retl
|
|
|
|
;
|
|
|
|
; SSE41-LABEL: sext_i8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; SSE41: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; SSE41-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
|
|
|
; SSE41-NEXT: movd %eax, %xmm0
|
|
|
|
; SSE41-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
|
|
|
; SSE41-NEXT: pinsrw $1, %eax, %xmm0
|
|
|
|
; SSE41-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
|
|
|
; SSE41-NEXT: pinsrw $2, %eax, %xmm0
|
2016-10-07 05:27:05 +08:00
|
|
|
; SSE41-NEXT: retl
|
|
|
|
;
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-32-LABEL: sext_i8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX-32: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; AVX-32-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX-32-NEXT: vmovd %eax, %xmm0
|
|
|
|
; AVX-32-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX-32-NEXT: vpinsrw $1, %eax, %xmm0, %xmm0
|
|
|
|
; AVX-32-NEXT: movsbl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX-32-NEXT: vpinsrw $2, %eax, %xmm0, %xmm0
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-32-NEXT: retl
|
2016-10-07 05:27:05 +08:00
|
|
|
;
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-64-LABEL: sext_i8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX-64: # %bb.0:
|
2019-08-16 02:58:25 +08:00
|
|
|
; AVX-64-NEXT: movsbl %sil, %eax
|
|
|
|
; AVX-64-NEXT: movsbl %dil, %ecx
|
|
|
|
; AVX-64-NEXT: vmovd %ecx, %xmm0
|
|
|
|
; AVX-64-NEXT: vpinsrw $1, %eax, %xmm0, %xmm0
|
|
|
|
; AVX-64-NEXT: movsbl %dl, %eax
|
|
|
|
; AVX-64-NEXT: vpinsrw $2, %eax, %xmm0, %xmm0
|
2016-10-07 22:42:22 +08:00
|
|
|
; AVX-64-NEXT: retq
|
2016-10-07 05:27:05 +08:00
|
|
|
%2 = sext <3 x i8> %0 to <3 x i16>
|
|
|
|
ret <3 x i16> %2
|
|
|
|
}
|