1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s
4 define <4 x i32> @trunc_64_32(<4 x i64> %A) nounwind uwtable readnone ssp{
5 ; CHECK-LABEL: trunc_64_32:
7 ; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
8 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]
9 ; CHECK-NEXT: vzeroupper
11 %B = trunc <4 x i64> %A to <4 x i32>
15 define <8 x i16> @trunc_32_16(<8 x i32> %A) nounwind uwtable readnone ssp{
16 ; CHECK-LABEL: trunc_32_16:
18 ; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
19 ; CHECK-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
20 ; CHECK-NEXT: vpshufb %xmm2, %xmm1, %xmm1
21 ; CHECK-NEXT: vpshufb %xmm2, %xmm0, %xmm0
22 ; CHECK-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
23 ; CHECK-NEXT: vzeroupper
25 %B = trunc <8 x i32> %A to <8 x i16>
29 define <16 x i8> @trunc_16_8(<16 x i16> %A) nounwind uwtable readnone ssp{
30 ; CHECK-LABEL: trunc_16_8:
32 ; CHECK-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
33 ; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
34 ; CHECK-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
35 ; CHECK-NEXT: vzeroupper
37 %B = trunc <16 x i16> %A to <16 x i8>