llvm.org GIT mirror llvm / 66fb8aa
[X86][XOP] More VPPERM shuffle mask decode tests As requested by D18441 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266531 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 4 years ago
1 changed file(s) with 104 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx,+xop | FileCheck %s --check-prefix=X32
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx,+xop | FileCheck %s --check-prefix=X64
3
4 ;
5 ; VPPERM
6 ;
7
8 define <16 x i8> @vpperm_shuffle_unary(<16 x i8> %a0) {
9 ; X32-LABEL: vpperm_shuffle_unary:
10 ; X32: # BB#0:
11 ; X32-NEXT: vpperm {{.*#+}} xmm0 = xmm0[15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
12 ; X32-NEXT: retl
13 ;
14 ; X64-LABEL: vpperm_shuffle_unary:
15 ; X64: # BB#0:
16 ; X64-NEXT: vpperm {{.*#+}} xmm0 = xmm0[15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
17 ; X64-NEXT: retq
18 %1 = tail call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %a0, <16 x i8> %a0, <16 x i8> )
19 ret <16 x i8> %1
20 }
21
22 define <16 x i8> @vpperm_shuffle_unary_undef(<16 x i8> %a0) {
23 ; X32-LABEL: vpperm_shuffle_unary_undef:
24 ; X32: # BB#0:
25 ; X32-NEXT: vpperm {{.*#+}} xmm0 = xmm0[15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
26 ; X32-NEXT: retl
27 ;
28 ; X64-LABEL: vpperm_shuffle_unary_undef:
29 ; X64: # BB#0:
30 ; X64-NEXT: vpperm {{.*#+}} xmm0 = xmm0[15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
31 ; X64-NEXT: retq
32 %1 = tail call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %a0, <16 x i8> undef, <16 x i8> )
33 ret <16 x i8> %1
34 }
35
36 define <16 x i8> @vpperm_shuffle_unary_zero(<16 x i8> %a0) {
37 ; X32-LABEL: vpperm_shuffle_unary_zero:
38 ; X32: # BB#0:
39 ; X32-NEXT: vpperm {{.*#+}} xmm0 = xmm0[15,14,13,12,11,10,9,8,7,6,5,4,3],zero,xmm0[1],zero
40 ; X32-NEXT: retl
41 ;
42 ; X64-LABEL: vpperm_shuffle_unary_zero:
43 ; X64: # BB#0:
44 ; X64-NEXT: vpperm {{.*#+}} xmm0 = xmm0[15,14,13,12,11,10,9,8,7,6,5,4,3],zero,xmm0[1],zero
45 ; X64-NEXT: retq
46 %1 = tail call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %a0, <16 x i8> %a0, <16 x i8> )
47 ret <16 x i8> %1
48 }
49
50 define <16 x i8> @vpperm_shuffle_binary(<16 x i8> %a0, <16 x i8> %a1) {
51 ; X32-LABEL: vpperm_shuffle_binary:
52 ; X32: # BB#0:
53 ; X32-NEXT: vpperm {{.*#+}} xmm0 = xmm1[15],xmm0[14],xmm1[13],xmm0[12],xmm1[11],xmm0[10],xmm1[9],xmm0[8],xmm1[7],xmm0[6],xmm1[5],xmm0[4],xmm1[3],xmm0[2],xmm1[1],xmm0[0]
54 ; X32-NEXT: retl
55 ;
56 ; X64-LABEL: vpperm_shuffle_binary:
57 ; X64: # BB#0:
58 ; X64-NEXT: vpperm {{.*#+}} xmm0 = xmm1[15],xmm0[14],xmm1[13],xmm0[12],xmm1[11],xmm0[10],xmm1[9],xmm0[8],xmm1[7],xmm0[6],xmm1[5],xmm0[4],xmm1[3],xmm0[2],xmm1[1],xmm0[0]
59 ; X64-NEXT: retq
60 %1 = tail call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %a0, <16 x i8> %a1, <16 x i8> )
61 ret <16 x i8> %1
62 }
63
64 define <16 x i8> @vpperm_shuffle_binary_zero(<16 x i8> %a0, <16 x i8> %a1) {
65 ; X32-LABEL: vpperm_shuffle_binary_zero:
66 ; X32: # BB#0:
67 ; X32-NEXT: vpperm {{.*#+}} xmm0 = xmm1[15],xmm0[14],xmm1[13],xmm0[12],xmm1[11],xmm0[10],xmm1[9],xmm0[8],xmm1[7],xmm0[6],xmm1[5],xmm0[4],zero,zero,zero,zero
68 ; X32-NEXT: retl
69 ;
70 ; X64-LABEL: vpperm_shuffle_binary_zero:
71 ; X64: # BB#0:
72 ; X64-NEXT: vpperm {{.*#+}} xmm0 = xmm1[15],xmm0[14],xmm1[13],xmm0[12],xmm1[11],xmm0[10],xmm1[9],xmm0[8],xmm1[7],xmm0[6],xmm1[5],xmm0[4],zero,zero,zero,zero
73 ; X64-NEXT: retq
74 %1 = tail call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %a0, <16 x i8> %a1, <16 x i8> )
75 ret <16 x i8> %1
76 }
77
78 ; we can't decode vpperm's other permute ops
79 define <16 x i8> @vpperm_shuffle_general(<16 x i8> %a0, <16 x i8> %a1) {
80 ; X32-LABEL: vpperm_shuffle_general:
81 ; X32: # BB#0:
82 ; X32-NEXT: vpperm .LCPI5_0, %xmm0, %xmm0, %xmm0
83 ; X32-NEXT: retl
84 ;
85 ; X64-LABEL: vpperm_shuffle_general:
86 ; X64: # BB#0:
87 ; X64-NEXT: vpperm {{.*}}(%rip), %xmm0, %xmm0, %xmm0
88 ; X64-NEXT: retq
89 %1 = tail call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %a0, <16 x i8> %a0, <16 x i8> )
90 ret <16 x i8> %1
91 }
92
93 ;
94 ; VPERMIL2
95 ;
96
97 declare <2 x double> @llvm.x86.xop.vpermil2pd(<2 x double>, <2 x double>, <2 x double>, i8) nounwind readnone
98 declare <4 x double> @llvm.x86.xop.vpermil2pd.256(<4 x double>, <4 x double>, <4 x double>, i8) nounwind readnone
99
100 declare <4 x float> @llvm.x86.xop.vpermil2ps(<4 x float>, <4 x float>, <4 x float>, i8) nounwind readnone
101 declare <8 x float> @llvm.x86.xop.vpermil2ps.256(<8 x float>, <8 x float>, <8 x float>, i8) nounwind readnone
102
103 declare <16 x i8> @llvm.x86.xop.vpperm(<16 x i8>, <16 x i8>, <16 x i8>) nounwind readnone