2016-01-16 23:25:02 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2016-12-13 07:16:35 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s
|
2012-02-03 03:00:49 +08:00
|
|
|
|
|
|
|
define <4 x i32> @trunc_64_32(<4 x i64> %A) nounwind uwtable readnone ssp{
|
2016-01-16 23:25:02 +08:00
|
|
|
; CHECK-LABEL: trunc_64_32:
|
2016-12-13 07:16:35 +08:00
|
|
|
; CHECK: # BB#0:
|
2016-01-16 23:25:02 +08:00
|
|
|
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
|
|
|
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,1,0,2]
|
|
|
|
; CHECK-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
|
|
|
|
; CHECK-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]
|
|
|
|
; CHECK-NEXT: vzeroupper
|
|
|
|
; CHECK-NEXT: retq
|
2012-02-03 03:00:49 +08:00
|
|
|
%B = trunc <4 x i64> %A to <4 x i32>
|
|
|
|
ret <4 x i32>%B
|
|
|
|
}
|
2016-01-16 23:25:02 +08:00
|
|
|
|
2012-02-03 03:00:49 +08:00
|
|
|
define <8 x i16> @trunc_32_16(<8 x i32> %A) nounwind uwtable readnone ssp{
|
2016-01-16 23:25:02 +08:00
|
|
|
; CHECK-LABEL: trunc_32_16:
|
2016-12-13 07:16:35 +08:00
|
|
|
; CHECK: # BB#0:
|
2016-01-16 23:25:02 +08:00
|
|
|
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
|
|
|
; CHECK-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
|
|
|
|
; CHECK-NEXT: vpshufb %xmm2, %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: vpshufb %xmm2, %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
|
|
|
|
; CHECK-NEXT: vzeroupper
|
|
|
|
; CHECK-NEXT: retq
|
2012-02-03 03:00:49 +08:00
|
|
|
%B = trunc <8 x i32> %A to <8 x i16>
|
|
|
|
ret <8 x i16>%B
|
|
|
|
}
|
2016-01-16 23:25:02 +08:00
|
|
|
|
2013-10-24 05:06:07 +08:00
|
|
|
define <16 x i8> @trunc_16_8(<16 x i16> %A) nounwind uwtable readnone ssp{
|
2016-01-16 23:25:02 +08:00
|
|
|
; CHECK-LABEL: trunc_16_8:
|
2016-12-13 07:16:35 +08:00
|
|
|
; CHECK: # BB#0:
|
2016-01-16 23:25:02 +08:00
|
|
|
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
|
|
|
; CHECK-NEXT: vmovdqa {{.*#+}} xmm2 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
|
|
|
|
; CHECK-NEXT: vpshufb %xmm2, %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: vpshufb %xmm2, %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
|
|
|
|
; CHECK-NEXT: vzeroupper
|
|
|
|
; CHECK-NEXT: retq
|
2013-10-24 05:06:07 +08:00
|
|
|
%B = trunc <16 x i16> %A to <16 x i8>
|
|
|
|
ret <16 x i8> %B
|
|
|
|
}
|