llvm.org GIT mirror llvm / b639f72
Regenerate PACKUS/TRUNCS test (PR31773) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317096 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
1 changed file(s) with 41 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=CHECK --check-prefix=AVX
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512
13
24 ; This matter of this test is ensuring that vpackus* is not used for umin+trunc combination, since vpackus* input is a signed number.
5
36 define <16 x i8> @usat_trunc_wb_256(<16 x i16> %i) {
4 ; CHECK-LABEL: usat_trunc_wb_256:
5 ; CHECK-NOT: vpackuswb %xmm1, %xmm0, %xmm0
7 ; AVX-LABEL: usat_trunc_wb_256:
8 ; AVX: # BB#0:
9 ; AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [255,255,255,255,255,255,255,255]
10 ; AVX-NEXT: vpminuw %xmm1, %xmm0, %xmm2
11 ; AVX-NEXT: vextractf128 $1, %ymm0, %xmm0
12 ; AVX-NEXT: vpminuw %xmm1, %xmm0, %xmm0
13 ; AVX-NEXT: vmovdqa {{.*#+}} xmm1 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
14 ; AVX-NEXT: vpshufb %xmm1, %xmm0, %xmm0
15 ; AVX-NEXT: vpshufb %xmm1, %xmm2, %xmm1
16 ; AVX-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm1[0],xmm0[0]
17 ; AVX-NEXT: vzeroupper
18 ; AVX-NEXT: retq
19 ;
20 ; AVX512-LABEL: usat_trunc_wb_256:
21 ; AVX512: # BB#0:
22 ; AVX512-NEXT: vpmovuswb %ymm0, %xmm0
23 ; AVX512-NEXT: vzeroupper
24 ; AVX512-NEXT: retq
625 %x3 = icmp ult <16 x i16> %i,
726 %x5 = select <16 x i1> %x3, <16 x i16> %i, <16 x i16>
827 %x6 = trunc <16 x i16> %x5 to <16 x i8>
928 ret <16 x i8> %x6
1029 }
11
30
1231 define <8 x i16> @usat_trunc_dw_256(<8 x i32> %i) {
13 ; CHECK-LABEL: usat_trunc_dw_256:
14 ; CHECK-NOT: vpackusdw %xmm1, %xmm0, %xmm0
32 ; AVX-LABEL: usat_trunc_dw_256:
33 ; AVX: # BB#0:
34 ; AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [65535,65535,65535,65535]
35 ; AVX-NEXT: vpminud %xmm1, %xmm0, %xmm2
36 ; AVX-NEXT: vextractf128 $1, %ymm0, %xmm0
37 ; AVX-NEXT: vpminud %xmm1, %xmm0, %xmm0
38 ; AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
39 ; AVX-NEXT: vpshufb %xmm1, %xmm0, %xmm0
40 ; AVX-NEXT: vpshufb %xmm1, %xmm2, %xmm1
41 ; AVX-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm1[0],xmm0[0]
42 ; AVX-NEXT: vzeroupper
43 ; AVX-NEXT: retq
44 ;
45 ; AVX512-LABEL: usat_trunc_dw_256:
46 ; AVX512: # BB#0:
47 ; AVX512-NEXT: vpmovusdw %ymm0, %xmm0
48 ; AVX512-NEXT: vzeroupper
49 ; AVX512-NEXT: retq
1550 %x3 = icmp ult <8 x i32> %i,
1651 %x5 = select <8 x i1> %x3, <8 x i32> %i, <8 x i32>
1752 %x6 = trunc <8 x i32> %x5 to <8 x i16>