xref: /aosp_15_r20/external/llvm/lib/Target/SystemZ/SystemZOperators.td (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker//===-- SystemZOperators.td - SystemZ-specific operators ------*- tblgen-*-===//
2*9880d681SAndroid Build Coastguard Worker//
3*9880d681SAndroid Build Coastguard Worker//                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker//
5*9880d681SAndroid Build Coastguard Worker// This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker// License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker//
8*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
11*9880d681SAndroid Build Coastguard Worker// Type profiles
12*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Workerdef SDT_CallSeqStart        : SDCallSeqStart<[SDTCisVT<0, i64>]>;
14*9880d681SAndroid Build Coastguard Workerdef SDT_CallSeqEnd          : SDCallSeqEnd<[SDTCisVT<0, i64>,
15*9880d681SAndroid Build Coastguard Worker                                            SDTCisVT<1, i64>]>;
16*9880d681SAndroid Build Coastguard Workerdef SDT_ZCall               : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;
17*9880d681SAndroid Build Coastguard Workerdef SDT_ZCmp                : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>;
18*9880d681SAndroid Build Coastguard Workerdef SDT_ZICmp               : SDTypeProfile<0, 3,
19*9880d681SAndroid Build Coastguard Worker                                            [SDTCisSameAs<0, 1>,
20*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>]>;
21*9880d681SAndroid Build Coastguard Workerdef SDT_ZBRCCMask           : SDTypeProfile<0, 3,
22*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, i32>,
23*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<1, i32>,
24*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, OtherVT>]>;
25*9880d681SAndroid Build Coastguard Workerdef SDT_ZSelectCCMask       : SDTypeProfile<1, 4,
26*9880d681SAndroid Build Coastguard Worker                                            [SDTCisSameAs<0, 1>,
27*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<1, 2>,
28*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<3, i32>,
29*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<4, i32>]>;
30*9880d681SAndroid Build Coastguard Workerdef SDT_ZWrapPtr            : SDTypeProfile<1, 1,
31*9880d681SAndroid Build Coastguard Worker                                            [SDTCisSameAs<0, 1>,
32*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<0>]>;
33*9880d681SAndroid Build Coastguard Workerdef SDT_ZWrapOffset         : SDTypeProfile<1, 2,
34*9880d681SAndroid Build Coastguard Worker                                            [SDTCisSameAs<0, 1>,
35*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 2>,
36*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<0>]>;
37*9880d681SAndroid Build Coastguard Workerdef SDT_ZAdjDynAlloc        : SDTypeProfile<1, 0, [SDTCisVT<0, i64>]>;
38*9880d681SAndroid Build Coastguard Workerdef SDT_ZExtractAccess      : SDTypeProfile<1, 1,
39*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, i32>,
40*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<1, i32>]>;
41*9880d681SAndroid Build Coastguard Workerdef SDT_ZGR128Binary32      : SDTypeProfile<1, 2,
42*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, untyped>,
43*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<1, untyped>,
44*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>]>;
45*9880d681SAndroid Build Coastguard Workerdef SDT_ZGR128Binary64      : SDTypeProfile<1, 2,
46*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, untyped>,
47*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<1, untyped>,
48*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i64>]>;
49*9880d681SAndroid Build Coastguard Workerdef SDT_ZAtomicLoadBinaryW  : SDTypeProfile<1, 5,
50*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, i32>,
51*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>,
52*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>,
53*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<3, i32>,
54*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<4, i32>,
55*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<5, i32>]>;
56*9880d681SAndroid Build Coastguard Workerdef SDT_ZAtomicCmpSwapW     : SDTypeProfile<1, 6,
57*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, i32>,
58*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>,
59*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>,
60*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<3, i32>,
61*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<4, i32>,
62*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<5, i32>,
63*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<6, i32>]>;
64*9880d681SAndroid Build Coastguard Workerdef SDT_ZMemMemLength       : SDTypeProfile<0, 3,
65*9880d681SAndroid Build Coastguard Worker                                            [SDTCisPtrTy<0>,
66*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>,
67*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i64>]>;
68*9880d681SAndroid Build Coastguard Workerdef SDT_ZMemMemLoop         : SDTypeProfile<0, 4,
69*9880d681SAndroid Build Coastguard Worker                                            [SDTCisPtrTy<0>,
70*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>,
71*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i64>,
72*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<3, i64>]>;
73*9880d681SAndroid Build Coastguard Workerdef SDT_ZString             : SDTypeProfile<1, 3,
74*9880d681SAndroid Build Coastguard Worker                                            [SDTCisPtrTy<0>,
75*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>,
76*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<2>,
77*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<3, i32>]>;
78*9880d681SAndroid Build Coastguard Workerdef SDT_ZI32Intrinsic       : SDTypeProfile<1, 0, [SDTCisVT<0, i32>]>;
79*9880d681SAndroid Build Coastguard Workerdef SDT_ZPrefetch           : SDTypeProfile<0, 2,
80*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, i32>,
81*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>]>;
82*9880d681SAndroid Build Coastguard Workerdef SDT_ZLoadBSwap          : SDTypeProfile<1, 2,
83*9880d681SAndroid Build Coastguard Worker                                            [SDTCisInt<0>,
84*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>,
85*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, OtherVT>]>;
86*9880d681SAndroid Build Coastguard Workerdef SDT_ZStoreBSwap         : SDTypeProfile<0, 3,
87*9880d681SAndroid Build Coastguard Worker                                            [SDTCisInt<0>,
88*9880d681SAndroid Build Coastguard Worker                                             SDTCisPtrTy<1>,
89*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, OtherVT>]>;
90*9880d681SAndroid Build Coastguard Workerdef SDT_ZTBegin             : SDTypeProfile<0, 2,
91*9880d681SAndroid Build Coastguard Worker                                            [SDTCisPtrTy<0>,
92*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<1, i32>]>;
93*9880d681SAndroid Build Coastguard Workerdef SDT_ZInsertVectorElt    : SDTypeProfile<1, 3,
94*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
95*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 1>,
96*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<3, i32>]>;
97*9880d681SAndroid Build Coastguard Workerdef SDT_ZExtractVectorElt   : SDTypeProfile<1, 2,
98*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<1>,
99*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>]>;
100*9880d681SAndroid Build Coastguard Workerdef SDT_ZReplicate          : SDTypeProfile<1, 1,
101*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>]>;
102*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecUnaryConv       : SDTypeProfile<1, 1,
103*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
104*9880d681SAndroid Build Coastguard Worker                                             SDTCisVec<1>]>;
105*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecUnary           : SDTypeProfile<1, 1,
106*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
107*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 1>]>;
108*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecBinary          : SDTypeProfile<1, 2,
109*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
110*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 1>,
111*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 2>]>;
112*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecBinaryInt       : SDTypeProfile<1, 2,
113*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
114*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 1>,
115*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>]>;
116*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecBinaryConv      : SDTypeProfile<1, 2,
117*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
118*9880d681SAndroid Build Coastguard Worker                                             SDTCisVec<1>,
119*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<1, 2>]>;
120*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecBinaryConvInt   : SDTypeProfile<1, 2,
121*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
122*9880d681SAndroid Build Coastguard Worker                                             SDTCisVec<1>,
123*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>]>;
124*9880d681SAndroid Build Coastguard Workerdef SDT_ZRotateMask         : SDTypeProfile<1, 2,
125*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
126*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<1, i32>,
127*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i32>]>;
128*9880d681SAndroid Build Coastguard Workerdef SDT_ZJoinDwords         : SDTypeProfile<1, 2,
129*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVT<0, v2i64>,
130*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<1, i64>,
131*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<2, i64>]>;
132*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecTernary         : SDTypeProfile<1, 3,
133*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
134*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 1>,
135*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 2>,
136*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 3>]>;
137*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecTernaryInt      : SDTypeProfile<1, 3,
138*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
139*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 1>,
140*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 2>,
141*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<3, i32>]>;
142*9880d681SAndroid Build Coastguard Workerdef SDT_ZVecQuaternaryInt   : SDTypeProfile<1, 4,
143*9880d681SAndroid Build Coastguard Worker                                            [SDTCisVec<0>,
144*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 1>,
145*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 2>,
146*9880d681SAndroid Build Coastguard Worker                                             SDTCisSameAs<0, 3>,
147*9880d681SAndroid Build Coastguard Worker                                             SDTCisVT<4, i32>]>;
148*9880d681SAndroid Build Coastguard Workerdef SDT_ZTest               : SDTypeProfile<0, 2, [SDTCisVT<1, i64>]>;
149*9880d681SAndroid Build Coastguard Worker
150*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
151*9880d681SAndroid Build Coastguard Worker// Node definitions
152*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
153*9880d681SAndroid Build Coastguard Worker
154*9880d681SAndroid Build Coastguard Worker// These are target-independent nodes, but have target-specific formats.
155*9880d681SAndroid Build Coastguard Workerdef callseq_start       : SDNode<"ISD::CALLSEQ_START", SDT_CallSeqStart,
156*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPSideEffect, SDNPOutGlue]>;
157*9880d681SAndroid Build Coastguard Workerdef callseq_end         : SDNode<"ISD::CALLSEQ_END",   SDT_CallSeqEnd,
158*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPSideEffect, SDNPOptInGlue,
159*9880d681SAndroid Build Coastguard Worker                                  SDNPOutGlue]>;
160*9880d681SAndroid Build Coastguard Workerdef global_offset_table : SDNode<"ISD::GLOBAL_OFFSET_TABLE", SDTPtrLeaf>;
161*9880d681SAndroid Build Coastguard Worker
162*9880d681SAndroid Build Coastguard Worker// Nodes for SystemZISD::*.  See SystemZISelLowering.h for more details.
163*9880d681SAndroid Build Coastguard Workerdef z_retflag           : SDNode<"SystemZISD::RET_FLAG", SDTNone,
164*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]>;
165*9880d681SAndroid Build Coastguard Workerdef z_call              : SDNode<"SystemZISD::CALL", SDT_ZCall,
166*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPOptInGlue,
167*9880d681SAndroid Build Coastguard Worker                                  SDNPVariadic]>;
168*9880d681SAndroid Build Coastguard Workerdef z_sibcall           : SDNode<"SystemZISD::SIBCALL", SDT_ZCall,
169*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPOptInGlue,
170*9880d681SAndroid Build Coastguard Worker                                  SDNPVariadic]>;
171*9880d681SAndroid Build Coastguard Workerdef z_tls_gdcall        : SDNode<"SystemZISD::TLS_GDCALL", SDT_ZCall,
172*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPInGlue, SDNPOutGlue,
173*9880d681SAndroid Build Coastguard Worker                                  SDNPVariadic]>;
174*9880d681SAndroid Build Coastguard Workerdef z_tls_ldcall        : SDNode<"SystemZISD::TLS_LDCALL", SDT_ZCall,
175*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPInGlue, SDNPOutGlue,
176*9880d681SAndroid Build Coastguard Worker                                  SDNPVariadic]>;
177*9880d681SAndroid Build Coastguard Workerdef z_pcrel_wrapper     : SDNode<"SystemZISD::PCREL_WRAPPER", SDT_ZWrapPtr, []>;
178*9880d681SAndroid Build Coastguard Workerdef z_pcrel_offset      : SDNode<"SystemZISD::PCREL_OFFSET",
179*9880d681SAndroid Build Coastguard Worker                                 SDT_ZWrapOffset, []>;
180*9880d681SAndroid Build Coastguard Workerdef z_iabs              : SDNode<"SystemZISD::IABS", SDTIntUnaryOp, []>;
181*9880d681SAndroid Build Coastguard Workerdef z_icmp              : SDNode<"SystemZISD::ICMP", SDT_ZICmp, [SDNPOutGlue]>;
182*9880d681SAndroid Build Coastguard Workerdef z_fcmp              : SDNode<"SystemZISD::FCMP", SDT_ZCmp, [SDNPOutGlue]>;
183*9880d681SAndroid Build Coastguard Workerdef z_tm                : SDNode<"SystemZISD::TM", SDT_ZICmp, [SDNPOutGlue]>;
184*9880d681SAndroid Build Coastguard Workerdef z_br_ccmask         : SDNode<"SystemZISD::BR_CCMASK", SDT_ZBRCCMask,
185*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPInGlue]>;
186*9880d681SAndroid Build Coastguard Workerdef z_select_ccmask     : SDNode<"SystemZISD::SELECT_CCMASK", SDT_ZSelectCCMask,
187*9880d681SAndroid Build Coastguard Worker    		                 [SDNPInGlue]>;
188*9880d681SAndroid Build Coastguard Workerdef z_adjdynalloc       : SDNode<"SystemZISD::ADJDYNALLOC", SDT_ZAdjDynAlloc>;
189*9880d681SAndroid Build Coastguard Workerdef z_extract_access    : SDNode<"SystemZISD::EXTRACT_ACCESS",
190*9880d681SAndroid Build Coastguard Worker                                 SDT_ZExtractAccess>;
191*9880d681SAndroid Build Coastguard Workerdef z_popcnt            : SDNode<"SystemZISD::POPCNT", SDTIntUnaryOp>;
192*9880d681SAndroid Build Coastguard Workerdef z_umul_lohi64       : SDNode<"SystemZISD::UMUL_LOHI64", SDT_ZGR128Binary64>;
193*9880d681SAndroid Build Coastguard Workerdef z_sdivrem32         : SDNode<"SystemZISD::SDIVREM32", SDT_ZGR128Binary32>;
194*9880d681SAndroid Build Coastguard Workerdef z_sdivrem64         : SDNode<"SystemZISD::SDIVREM64", SDT_ZGR128Binary64>;
195*9880d681SAndroid Build Coastguard Workerdef z_udivrem32         : SDNode<"SystemZISD::UDIVREM32", SDT_ZGR128Binary32>;
196*9880d681SAndroid Build Coastguard Workerdef z_udivrem64         : SDNode<"SystemZISD::UDIVREM64", SDT_ZGR128Binary64>;
197*9880d681SAndroid Build Coastguard Worker
198*9880d681SAndroid Build Coastguard Workerdef z_serialize         : SDNode<"SystemZISD::SERIALIZE", SDTNone,
199*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPMayStore]>;
200*9880d681SAndroid Build Coastguard Workerdef z_membarrier        : SDNode<"SystemZISD::MEMBARRIER", SDTNone,
201*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPSideEffect]>;
202*9880d681SAndroid Build Coastguard Worker
203*9880d681SAndroid Build Coastguard Workerdef z_loadbswap        : SDNode<"SystemZISD::LRV", SDT_ZLoadBSwap,
204*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>;
205*9880d681SAndroid Build Coastguard Workerdef z_storebswap       : SDNode<"SystemZISD::STRV", SDT_ZStoreBSwap,
206*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>;
207*9880d681SAndroid Build Coastguard Worker
208*9880d681SAndroid Build Coastguard Workerdef z_tdc               : SDNode<"SystemZISD::TDC", SDT_ZTest, [SDNPOutGlue]>;
209*9880d681SAndroid Build Coastguard Worker
210*9880d681SAndroid Build Coastguard Worker// Defined because the index is an i32 rather than a pointer.
211*9880d681SAndroid Build Coastguard Workerdef z_vector_insert     : SDNode<"ISD::INSERT_VECTOR_ELT",
212*9880d681SAndroid Build Coastguard Worker                                 SDT_ZInsertVectorElt>;
213*9880d681SAndroid Build Coastguard Workerdef z_vector_extract    : SDNode<"ISD::EXTRACT_VECTOR_ELT",
214*9880d681SAndroid Build Coastguard Worker                                 SDT_ZExtractVectorElt>;
215*9880d681SAndroid Build Coastguard Workerdef z_byte_mask         : SDNode<"SystemZISD::BYTE_MASK", SDT_ZReplicate>;
216*9880d681SAndroid Build Coastguard Workerdef z_rotate_mask       : SDNode<"SystemZISD::ROTATE_MASK", SDT_ZRotateMask>;
217*9880d681SAndroid Build Coastguard Workerdef z_replicate         : SDNode<"SystemZISD::REPLICATE", SDT_ZReplicate>;
218*9880d681SAndroid Build Coastguard Workerdef z_join_dwords       : SDNode<"SystemZISD::JOIN_DWORDS", SDT_ZJoinDwords>;
219*9880d681SAndroid Build Coastguard Workerdef z_splat             : SDNode<"SystemZISD::SPLAT", SDT_ZVecBinaryInt>;
220*9880d681SAndroid Build Coastguard Workerdef z_merge_high        : SDNode<"SystemZISD::MERGE_HIGH", SDT_ZVecBinary>;
221*9880d681SAndroid Build Coastguard Workerdef z_merge_low         : SDNode<"SystemZISD::MERGE_LOW", SDT_ZVecBinary>;
222*9880d681SAndroid Build Coastguard Workerdef z_shl_double        : SDNode<"SystemZISD::SHL_DOUBLE", SDT_ZVecTernaryInt>;
223*9880d681SAndroid Build Coastguard Workerdef z_permute_dwords    : SDNode<"SystemZISD::PERMUTE_DWORDS",
224*9880d681SAndroid Build Coastguard Worker                                 SDT_ZVecTernaryInt>;
225*9880d681SAndroid Build Coastguard Workerdef z_permute           : SDNode<"SystemZISD::PERMUTE", SDT_ZVecTernary>;
226*9880d681SAndroid Build Coastguard Workerdef z_pack              : SDNode<"SystemZISD::PACK", SDT_ZVecBinaryConv>;
227*9880d681SAndroid Build Coastguard Workerdef z_packs_cc          : SDNode<"SystemZISD::PACKS_CC", SDT_ZVecBinaryConv,
228*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
229*9880d681SAndroid Build Coastguard Workerdef z_packls_cc         : SDNode<"SystemZISD::PACKLS_CC", SDT_ZVecBinaryConv,
230*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
231*9880d681SAndroid Build Coastguard Workerdef z_unpack_high       : SDNode<"SystemZISD::UNPACK_HIGH", SDT_ZVecUnaryConv>;
232*9880d681SAndroid Build Coastguard Workerdef z_unpackl_high      : SDNode<"SystemZISD::UNPACKL_HIGH", SDT_ZVecUnaryConv>;
233*9880d681SAndroid Build Coastguard Workerdef z_unpack_low        : SDNode<"SystemZISD::UNPACK_LOW", SDT_ZVecUnaryConv>;
234*9880d681SAndroid Build Coastguard Workerdef z_unpackl_low       : SDNode<"SystemZISD::UNPACKL_LOW", SDT_ZVecUnaryConv>;
235*9880d681SAndroid Build Coastguard Workerdef z_vshl_by_scalar    : SDNode<"SystemZISD::VSHL_BY_SCALAR",
236*9880d681SAndroid Build Coastguard Worker                                 SDT_ZVecBinaryInt>;
237*9880d681SAndroid Build Coastguard Workerdef z_vsrl_by_scalar    : SDNode<"SystemZISD::VSRL_BY_SCALAR",
238*9880d681SAndroid Build Coastguard Worker                                 SDT_ZVecBinaryInt>;
239*9880d681SAndroid Build Coastguard Workerdef z_vsra_by_scalar    : SDNode<"SystemZISD::VSRA_BY_SCALAR",
240*9880d681SAndroid Build Coastguard Worker                                 SDT_ZVecBinaryInt>;
241*9880d681SAndroid Build Coastguard Workerdef z_vsum              : SDNode<"SystemZISD::VSUM", SDT_ZVecBinaryConv>;
242*9880d681SAndroid Build Coastguard Workerdef z_vicmpe            : SDNode<"SystemZISD::VICMPE", SDT_ZVecBinary>;
243*9880d681SAndroid Build Coastguard Workerdef z_vicmph            : SDNode<"SystemZISD::VICMPH", SDT_ZVecBinary>;
244*9880d681SAndroid Build Coastguard Workerdef z_vicmphl           : SDNode<"SystemZISD::VICMPHL", SDT_ZVecBinary>;
245*9880d681SAndroid Build Coastguard Workerdef z_vicmpes           : SDNode<"SystemZISD::VICMPES", SDT_ZVecBinary,
246*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
247*9880d681SAndroid Build Coastguard Workerdef z_vicmphs           : SDNode<"SystemZISD::VICMPHS", SDT_ZVecBinary,
248*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
249*9880d681SAndroid Build Coastguard Workerdef z_vicmphls          : SDNode<"SystemZISD::VICMPHLS", SDT_ZVecBinary,
250*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
251*9880d681SAndroid Build Coastguard Workerdef z_vfcmpe            : SDNode<"SystemZISD::VFCMPE", SDT_ZVecBinaryConv>;
252*9880d681SAndroid Build Coastguard Workerdef z_vfcmph            : SDNode<"SystemZISD::VFCMPH", SDT_ZVecBinaryConv>;
253*9880d681SAndroid Build Coastguard Workerdef z_vfcmphe           : SDNode<"SystemZISD::VFCMPHE", SDT_ZVecBinaryConv>;
254*9880d681SAndroid Build Coastguard Workerdef z_vfcmpes           : SDNode<"SystemZISD::VFCMPES", SDT_ZVecBinaryConv,
255*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
256*9880d681SAndroid Build Coastguard Workerdef z_vfcmphs           : SDNode<"SystemZISD::VFCMPHS", SDT_ZVecBinaryConv,
257*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
258*9880d681SAndroid Build Coastguard Workerdef z_vfcmphes          : SDNode<"SystemZISD::VFCMPHES", SDT_ZVecBinaryConv,
259*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
260*9880d681SAndroid Build Coastguard Workerdef z_vextend           : SDNode<"SystemZISD::VEXTEND", SDT_ZVecUnaryConv>;
261*9880d681SAndroid Build Coastguard Workerdef z_vround            : SDNode<"SystemZISD::VROUND", SDT_ZVecUnaryConv>;
262*9880d681SAndroid Build Coastguard Workerdef z_vtm               : SDNode<"SystemZISD::VTM", SDT_ZCmp, [SDNPOutGlue]>;
263*9880d681SAndroid Build Coastguard Workerdef z_vfae_cc           : SDNode<"SystemZISD::VFAE_CC", SDT_ZVecTernaryInt,
264*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
265*9880d681SAndroid Build Coastguard Workerdef z_vfaez_cc          : SDNode<"SystemZISD::VFAEZ_CC", SDT_ZVecTernaryInt,
266*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
267*9880d681SAndroid Build Coastguard Workerdef z_vfee_cc           : SDNode<"SystemZISD::VFEE_CC", SDT_ZVecBinary,
268*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
269*9880d681SAndroid Build Coastguard Workerdef z_vfeez_cc          : SDNode<"SystemZISD::VFEEZ_CC", SDT_ZVecBinary,
270*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
271*9880d681SAndroid Build Coastguard Workerdef z_vfene_cc          : SDNode<"SystemZISD::VFENE_CC", SDT_ZVecBinary,
272*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
273*9880d681SAndroid Build Coastguard Workerdef z_vfenez_cc         : SDNode<"SystemZISD::VFENEZ_CC", SDT_ZVecBinary,
274*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
275*9880d681SAndroid Build Coastguard Workerdef z_vistr_cc          : SDNode<"SystemZISD::VISTR_CC", SDT_ZVecUnary,
276*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
277*9880d681SAndroid Build Coastguard Workerdef z_vstrc_cc          : SDNode<"SystemZISD::VSTRC_CC", SDT_ZVecQuaternaryInt,
278*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
279*9880d681SAndroid Build Coastguard Workerdef z_vstrcz_cc         : SDNode<"SystemZISD::VSTRCZ_CC",
280*9880d681SAndroid Build Coastguard Worker                                 SDT_ZVecQuaternaryInt, [SDNPOutGlue]>;
281*9880d681SAndroid Build Coastguard Workerdef z_vftci             : SDNode<"SystemZISD::VFTCI", SDT_ZVecBinaryConvInt,
282*9880d681SAndroid Build Coastguard Worker                                 [SDNPOutGlue]>;
283*9880d681SAndroid Build Coastguard Worker
284*9880d681SAndroid Build Coastguard Workerclass AtomicWOp<string name, SDTypeProfile profile = SDT_ZAtomicLoadBinaryW>
285*9880d681SAndroid Build Coastguard Worker  : SDNode<"SystemZISD::"##name, profile,
286*9880d681SAndroid Build Coastguard Worker           [SDNPHasChain, SDNPMayStore, SDNPMayLoad, SDNPMemOperand]>;
287*9880d681SAndroid Build Coastguard Worker
288*9880d681SAndroid Build Coastguard Workerdef z_atomic_swapw      : AtomicWOp<"ATOMIC_SWAPW">;
289*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_add  : AtomicWOp<"ATOMIC_LOADW_ADD">;
290*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_sub  : AtomicWOp<"ATOMIC_LOADW_SUB">;
291*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_and  : AtomicWOp<"ATOMIC_LOADW_AND">;
292*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_or   : AtomicWOp<"ATOMIC_LOADW_OR">;
293*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_xor  : AtomicWOp<"ATOMIC_LOADW_XOR">;
294*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_nand : AtomicWOp<"ATOMIC_LOADW_NAND">;
295*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_min  : AtomicWOp<"ATOMIC_LOADW_MIN">;
296*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_max  : AtomicWOp<"ATOMIC_LOADW_MAX">;
297*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_umin : AtomicWOp<"ATOMIC_LOADW_UMIN">;
298*9880d681SAndroid Build Coastguard Workerdef z_atomic_loadw_umax : AtomicWOp<"ATOMIC_LOADW_UMAX">;
299*9880d681SAndroid Build Coastguard Workerdef z_atomic_cmp_swapw  : AtomicWOp<"ATOMIC_CMP_SWAPW", SDT_ZAtomicCmpSwapW>;
300*9880d681SAndroid Build Coastguard Worker
301*9880d681SAndroid Build Coastguard Workerdef z_mvc               : SDNode<"SystemZISD::MVC", SDT_ZMemMemLength,
302*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
303*9880d681SAndroid Build Coastguard Workerdef z_mvc_loop          : SDNode<"SystemZISD::MVC_LOOP", SDT_ZMemMemLoop,
304*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
305*9880d681SAndroid Build Coastguard Workerdef z_nc                : SDNode<"SystemZISD::NC", SDT_ZMemMemLength,
306*9880d681SAndroid Build Coastguard Worker                                  [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
307*9880d681SAndroid Build Coastguard Workerdef z_nc_loop           : SDNode<"SystemZISD::NC_LOOP", SDT_ZMemMemLoop,
308*9880d681SAndroid Build Coastguard Worker                                  [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
309*9880d681SAndroid Build Coastguard Workerdef z_oc                : SDNode<"SystemZISD::OC", SDT_ZMemMemLength,
310*9880d681SAndroid Build Coastguard Worker                                  [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
311*9880d681SAndroid Build Coastguard Workerdef z_oc_loop           : SDNode<"SystemZISD::OC_LOOP", SDT_ZMemMemLoop,
312*9880d681SAndroid Build Coastguard Worker                                  [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
313*9880d681SAndroid Build Coastguard Workerdef z_xc                : SDNode<"SystemZISD::XC", SDT_ZMemMemLength,
314*9880d681SAndroid Build Coastguard Worker                                  [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
315*9880d681SAndroid Build Coastguard Workerdef z_xc_loop           : SDNode<"SystemZISD::XC_LOOP", SDT_ZMemMemLoop,
316*9880d681SAndroid Build Coastguard Worker                                  [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
317*9880d681SAndroid Build Coastguard Workerdef z_clc               : SDNode<"SystemZISD::CLC", SDT_ZMemMemLength,
318*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPMayLoad]>;
319*9880d681SAndroid Build Coastguard Workerdef z_clc_loop          : SDNode<"SystemZISD::CLC_LOOP", SDT_ZMemMemLoop,
320*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPMayLoad]>;
321*9880d681SAndroid Build Coastguard Workerdef z_strcmp            : SDNode<"SystemZISD::STRCMP", SDT_ZString,
322*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPMayLoad]>;
323*9880d681SAndroid Build Coastguard Workerdef z_stpcpy            : SDNode<"SystemZISD::STPCPY", SDT_ZString,
324*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
325*9880d681SAndroid Build Coastguard Workerdef z_search_string     : SDNode<"SystemZISD::SEARCH_STRING", SDT_ZString,
326*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPMayLoad]>;
327*9880d681SAndroid Build Coastguard Workerdef z_ipm               : SDNode<"SystemZISD::IPM", SDT_ZI32Intrinsic,
328*9880d681SAndroid Build Coastguard Worker                                 [SDNPInGlue]>;
329*9880d681SAndroid Build Coastguard Workerdef z_prefetch          : SDNode<"SystemZISD::PREFETCH", SDT_ZPrefetch,
330*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPMayLoad, SDNPMayStore,
331*9880d681SAndroid Build Coastguard Worker                                  SDNPMemOperand]>;
332*9880d681SAndroid Build Coastguard Worker
333*9880d681SAndroid Build Coastguard Workerdef z_tbegin            : SDNode<"SystemZISD::TBEGIN", SDT_ZTBegin,
334*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPMayStore,
335*9880d681SAndroid Build Coastguard Worker                                  SDNPSideEffect]>;
336*9880d681SAndroid Build Coastguard Workerdef z_tbegin_nofloat    : SDNode<"SystemZISD::TBEGIN_NOFLOAT", SDT_ZTBegin,
337*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPMayStore,
338*9880d681SAndroid Build Coastguard Worker                                  SDNPSideEffect]>;
339*9880d681SAndroid Build Coastguard Workerdef z_tend              : SDNode<"SystemZISD::TEND", SDTNone,
340*9880d681SAndroid Build Coastguard Worker                                 [SDNPHasChain, SDNPOutGlue, SDNPSideEffect]>;
341*9880d681SAndroid Build Coastguard Worker
342*9880d681SAndroid Build Coastguard Workerdef z_vshl              : SDNode<"ISD::SHL", SDT_ZVecBinary>;
343*9880d681SAndroid Build Coastguard Workerdef z_vsra              : SDNode<"ISD::SRA", SDT_ZVecBinary>;
344*9880d681SAndroid Build Coastguard Workerdef z_vsrl              : SDNode<"ISD::SRL", SDT_ZVecBinary>;
345*9880d681SAndroid Build Coastguard Worker
346*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
347*9880d681SAndroid Build Coastguard Worker// Pattern fragments
348*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
349*9880d681SAndroid Build Coastguard Worker
350*9880d681SAndroid Build Coastguard Workerdef z_lrvh  : PatFrag<(ops node:$addr), (z_loadbswap node:$addr, i16)>;
351*9880d681SAndroid Build Coastguard Workerdef z_lrv   : PatFrag<(ops node:$addr), (z_loadbswap node:$addr, i32)>;
352*9880d681SAndroid Build Coastguard Workerdef z_lrvg  : PatFrag<(ops node:$addr), (z_loadbswap node:$addr, i64)>;
353*9880d681SAndroid Build Coastguard Worker
354*9880d681SAndroid Build Coastguard Workerdef z_strvh : PatFrag<(ops node:$src, node:$addr),
355*9880d681SAndroid Build Coastguard Worker                      (z_storebswap node:$src, node:$addr, i16)>;
356*9880d681SAndroid Build Coastguard Workerdef z_strv  : PatFrag<(ops node:$src, node:$addr),
357*9880d681SAndroid Build Coastguard Worker                      (z_storebswap node:$src, node:$addr, i32)>;
358*9880d681SAndroid Build Coastguard Workerdef z_strvg : PatFrag<(ops node:$src, node:$addr),
359*9880d681SAndroid Build Coastguard Worker                      (z_storebswap node:$src, node:$addr, i64)>;
360*9880d681SAndroid Build Coastguard Worker
361*9880d681SAndroid Build Coastguard Worker// Signed and unsigned comparisons.
362*9880d681SAndroid Build Coastguard Workerdef z_scmp : PatFrag<(ops node:$a, node:$b), (z_icmp node:$a, node:$b, imm), [{
363*9880d681SAndroid Build Coastguard Worker  unsigned Type = cast<ConstantSDNode>(N->getOperand(2))->getZExtValue();
364*9880d681SAndroid Build Coastguard Worker  return Type != SystemZICMP::UnsignedOnly;
365*9880d681SAndroid Build Coastguard Worker}]>;
366*9880d681SAndroid Build Coastguard Workerdef z_ucmp : PatFrag<(ops node:$a, node:$b), (z_icmp node:$a, node:$b, imm), [{
367*9880d681SAndroid Build Coastguard Worker  unsigned Type = cast<ConstantSDNode>(N->getOperand(2))->getZExtValue();
368*9880d681SAndroid Build Coastguard Worker  return Type != SystemZICMP::SignedOnly;
369*9880d681SAndroid Build Coastguard Worker}]>;
370*9880d681SAndroid Build Coastguard Worker
371*9880d681SAndroid Build Coastguard Worker// Register- and memory-based TEST UNDER MASK.
372*9880d681SAndroid Build Coastguard Workerdef z_tm_reg : PatFrag<(ops node:$a, node:$b), (z_tm node:$a, node:$b, imm)>;
373*9880d681SAndroid Build Coastguard Workerdef z_tm_mem : PatFrag<(ops node:$a, node:$b), (z_tm node:$a, node:$b, 0)>;
374*9880d681SAndroid Build Coastguard Worker
375*9880d681SAndroid Build Coastguard Worker// Register sign-extend operations.  Sub-32-bit values are represented as i32s.
376*9880d681SAndroid Build Coastguard Workerdef sext8  : PatFrag<(ops node:$src), (sext_inreg node:$src, i8)>;
377*9880d681SAndroid Build Coastguard Workerdef sext16 : PatFrag<(ops node:$src), (sext_inreg node:$src, i16)>;
378*9880d681SAndroid Build Coastguard Workerdef sext32 : PatFrag<(ops node:$src), (sext (i32 node:$src))>;
379*9880d681SAndroid Build Coastguard Worker
380*9880d681SAndroid Build Coastguard Worker// Match extensions of an i32 to an i64, followed by an in-register sign
381*9880d681SAndroid Build Coastguard Worker// extension from a sub-i32 value.
382*9880d681SAndroid Build Coastguard Workerdef sext8dbl : PatFrag<(ops node:$src), (sext8 (anyext node:$src))>;
383*9880d681SAndroid Build Coastguard Workerdef sext16dbl : PatFrag<(ops node:$src), (sext16 (anyext node:$src))>;
384*9880d681SAndroid Build Coastguard Worker
385*9880d681SAndroid Build Coastguard Worker// Register zero-extend operations.  Sub-32-bit values are represented as i32s.
386*9880d681SAndroid Build Coastguard Workerdef zext8  : PatFrag<(ops node:$src), (and node:$src, 0xff)>;
387*9880d681SAndroid Build Coastguard Workerdef zext16 : PatFrag<(ops node:$src), (and node:$src, 0xffff)>;
388*9880d681SAndroid Build Coastguard Workerdef zext32 : PatFrag<(ops node:$src), (zext (i32 node:$src))>;
389*9880d681SAndroid Build Coastguard Worker
390*9880d681SAndroid Build Coastguard Worker// Match extensions of an i32 to an i64, followed by an AND of the low
391*9880d681SAndroid Build Coastguard Worker// i8 or i16 part.
392*9880d681SAndroid Build Coastguard Workerdef zext8dbl : PatFrag<(ops node:$src), (zext8 (anyext node:$src))>;
393*9880d681SAndroid Build Coastguard Workerdef zext16dbl : PatFrag<(ops node:$src), (zext16 (anyext node:$src))>;
394*9880d681SAndroid Build Coastguard Worker
395*9880d681SAndroid Build Coastguard Worker// Typed floating-point loads.
396*9880d681SAndroid Build Coastguard Workerdef loadf32 : PatFrag<(ops node:$src), (f32 (load node:$src))>;
397*9880d681SAndroid Build Coastguard Workerdef loadf64 : PatFrag<(ops node:$src), (f64 (load node:$src))>;
398*9880d681SAndroid Build Coastguard Worker
399*9880d681SAndroid Build Coastguard Worker// Extending loads in which the extension type can be signed.
400*9880d681SAndroid Build Coastguard Workerdef asextload : PatFrag<(ops node:$ptr), (unindexedload node:$ptr), [{
401*9880d681SAndroid Build Coastguard Worker  unsigned Type = cast<LoadSDNode>(N)->getExtensionType();
402*9880d681SAndroid Build Coastguard Worker  return Type == ISD::EXTLOAD || Type == ISD::SEXTLOAD;
403*9880d681SAndroid Build Coastguard Worker}]>;
404*9880d681SAndroid Build Coastguard Workerdef asextloadi8 : PatFrag<(ops node:$ptr), (asextload node:$ptr), [{
405*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i8;
406*9880d681SAndroid Build Coastguard Worker}]>;
407*9880d681SAndroid Build Coastguard Workerdef asextloadi16 : PatFrag<(ops node:$ptr), (asextload node:$ptr), [{
408*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i16;
409*9880d681SAndroid Build Coastguard Worker}]>;
410*9880d681SAndroid Build Coastguard Workerdef asextloadi32 : PatFrag<(ops node:$ptr), (asextload node:$ptr), [{
411*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i32;
412*9880d681SAndroid Build Coastguard Worker}]>;
413*9880d681SAndroid Build Coastguard Worker
414*9880d681SAndroid Build Coastguard Worker// Extending loads in which the extension type can be unsigned.
415*9880d681SAndroid Build Coastguard Workerdef azextload : PatFrag<(ops node:$ptr), (unindexedload node:$ptr), [{
416*9880d681SAndroid Build Coastguard Worker  unsigned Type = cast<LoadSDNode>(N)->getExtensionType();
417*9880d681SAndroid Build Coastguard Worker  return Type == ISD::EXTLOAD || Type == ISD::ZEXTLOAD;
418*9880d681SAndroid Build Coastguard Worker}]>;
419*9880d681SAndroid Build Coastguard Workerdef azextloadi8 : PatFrag<(ops node:$ptr), (azextload node:$ptr), [{
420*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i8;
421*9880d681SAndroid Build Coastguard Worker}]>;
422*9880d681SAndroid Build Coastguard Workerdef azextloadi16 : PatFrag<(ops node:$ptr), (azextload node:$ptr), [{
423*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i16;
424*9880d681SAndroid Build Coastguard Worker}]>;
425*9880d681SAndroid Build Coastguard Workerdef azextloadi32 : PatFrag<(ops node:$ptr), (azextload node:$ptr), [{
426*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i32;
427*9880d681SAndroid Build Coastguard Worker}]>;
428*9880d681SAndroid Build Coastguard Worker
429*9880d681SAndroid Build Coastguard Worker// Extending loads in which the extension type doesn't matter.
430*9880d681SAndroid Build Coastguard Workerdef anyextload : PatFrag<(ops node:$ptr), (unindexedload node:$ptr), [{
431*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getExtensionType() != ISD::NON_EXTLOAD;
432*9880d681SAndroid Build Coastguard Worker}]>;
433*9880d681SAndroid Build Coastguard Workerdef anyextloadi8 : PatFrag<(ops node:$ptr), (anyextload node:$ptr), [{
434*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i8;
435*9880d681SAndroid Build Coastguard Worker}]>;
436*9880d681SAndroid Build Coastguard Workerdef anyextloadi16 : PatFrag<(ops node:$ptr), (anyextload node:$ptr), [{
437*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i16;
438*9880d681SAndroid Build Coastguard Worker}]>;
439*9880d681SAndroid Build Coastguard Workerdef anyextloadi32 : PatFrag<(ops node:$ptr), (anyextload node:$ptr), [{
440*9880d681SAndroid Build Coastguard Worker  return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i32;
441*9880d681SAndroid Build Coastguard Worker}]>;
442*9880d681SAndroid Build Coastguard Worker
443*9880d681SAndroid Build Coastguard Worker// Aligned loads.
444*9880d681SAndroid Build Coastguard Workerclass AlignedLoad<SDPatternOperator load>
445*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$addr), (load node:$addr), [{
446*9880d681SAndroid Build Coastguard Worker  auto *Load = cast<LoadSDNode>(N);
447*9880d681SAndroid Build Coastguard Worker  return Load->getAlignment() >= Load->getMemoryVT().getStoreSize();
448*9880d681SAndroid Build Coastguard Worker}]>;
449*9880d681SAndroid Build Coastguard Workerdef aligned_load         : AlignedLoad<load>;
450*9880d681SAndroid Build Coastguard Workerdef aligned_asextloadi16 : AlignedLoad<asextloadi16>;
451*9880d681SAndroid Build Coastguard Workerdef aligned_asextloadi32 : AlignedLoad<asextloadi32>;
452*9880d681SAndroid Build Coastguard Workerdef aligned_azextloadi16 : AlignedLoad<azextloadi16>;
453*9880d681SAndroid Build Coastguard Workerdef aligned_azextloadi32 : AlignedLoad<azextloadi32>;
454*9880d681SAndroid Build Coastguard Worker
455*9880d681SAndroid Build Coastguard Worker// Aligned stores.
456*9880d681SAndroid Build Coastguard Workerclass AlignedStore<SDPatternOperator store>
457*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$src, node:$addr), (store node:$src, node:$addr), [{
458*9880d681SAndroid Build Coastguard Worker  auto *Store = cast<StoreSDNode>(N);
459*9880d681SAndroid Build Coastguard Worker  return Store->getAlignment() >= Store->getMemoryVT().getStoreSize();
460*9880d681SAndroid Build Coastguard Worker}]>;
461*9880d681SAndroid Build Coastguard Workerdef aligned_store         : AlignedStore<store>;
462*9880d681SAndroid Build Coastguard Workerdef aligned_truncstorei16 : AlignedStore<truncstorei16>;
463*9880d681SAndroid Build Coastguard Workerdef aligned_truncstorei32 : AlignedStore<truncstorei32>;
464*9880d681SAndroid Build Coastguard Worker
465*9880d681SAndroid Build Coastguard Worker// Non-volatile loads.  Used for instructions that might access the storage
466*9880d681SAndroid Build Coastguard Worker// location multiple times.
467*9880d681SAndroid Build Coastguard Workerclass NonvolatileLoad<SDPatternOperator load>
468*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$addr), (load node:$addr), [{
469*9880d681SAndroid Build Coastguard Worker  auto *Load = cast<LoadSDNode>(N);
470*9880d681SAndroid Build Coastguard Worker  return !Load->isVolatile();
471*9880d681SAndroid Build Coastguard Worker}]>;
472*9880d681SAndroid Build Coastguard Workerdef nonvolatile_load          : NonvolatileLoad<load>;
473*9880d681SAndroid Build Coastguard Workerdef nonvolatile_anyextloadi8  : NonvolatileLoad<anyextloadi8>;
474*9880d681SAndroid Build Coastguard Workerdef nonvolatile_anyextloadi16 : NonvolatileLoad<anyextloadi16>;
475*9880d681SAndroid Build Coastguard Workerdef nonvolatile_anyextloadi32 : NonvolatileLoad<anyextloadi32>;
476*9880d681SAndroid Build Coastguard Worker
477*9880d681SAndroid Build Coastguard Worker// Non-volatile stores.
478*9880d681SAndroid Build Coastguard Workerclass NonvolatileStore<SDPatternOperator store>
479*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$src, node:$addr), (store node:$src, node:$addr), [{
480*9880d681SAndroid Build Coastguard Worker  auto *Store = cast<StoreSDNode>(N);
481*9880d681SAndroid Build Coastguard Worker  return !Store->isVolatile();
482*9880d681SAndroid Build Coastguard Worker}]>;
483*9880d681SAndroid Build Coastguard Workerdef nonvolatile_store         : NonvolatileStore<store>;
484*9880d681SAndroid Build Coastguard Workerdef nonvolatile_truncstorei8  : NonvolatileStore<truncstorei8>;
485*9880d681SAndroid Build Coastguard Workerdef nonvolatile_truncstorei16 : NonvolatileStore<truncstorei16>;
486*9880d681SAndroid Build Coastguard Workerdef nonvolatile_truncstorei32 : NonvolatileStore<truncstorei32>;
487*9880d681SAndroid Build Coastguard Worker
488*9880d681SAndroid Build Coastguard Worker// A store of a load that can be implemented using MVC.
489*9880d681SAndroid Build Coastguard Workerdef mvc_store : PatFrag<(ops node:$value, node:$addr),
490*9880d681SAndroid Build Coastguard Worker                        (unindexedstore node:$value, node:$addr),
491*9880d681SAndroid Build Coastguard Worker                        [{ return storeLoadCanUseMVC(N); }]>;
492*9880d681SAndroid Build Coastguard Worker
493*9880d681SAndroid Build Coastguard Worker// Binary read-modify-write operations on memory in which the other
494*9880d681SAndroid Build Coastguard Worker// operand is also memory and for which block operations like NC can
495*9880d681SAndroid Build Coastguard Worker// be used.  There are two patterns for each operator, depending on
496*9880d681SAndroid Build Coastguard Worker// which operand contains the "other" load.
497*9880d681SAndroid Build Coastguard Workermulticlass block_op<SDPatternOperator operator> {
498*9880d681SAndroid Build Coastguard Worker  def "1" : PatFrag<(ops node:$value, node:$addr),
499*9880d681SAndroid Build Coastguard Worker                    (unindexedstore (operator node:$value,
500*9880d681SAndroid Build Coastguard Worker                                              (unindexedload node:$addr)),
501*9880d681SAndroid Build Coastguard Worker                                    node:$addr),
502*9880d681SAndroid Build Coastguard Worker                    [{ return storeLoadCanUseBlockBinary(N, 0); }]>;
503*9880d681SAndroid Build Coastguard Worker  def "2" : PatFrag<(ops node:$value, node:$addr),
504*9880d681SAndroid Build Coastguard Worker                    (unindexedstore (operator (unindexedload node:$addr),
505*9880d681SAndroid Build Coastguard Worker                                              node:$value),
506*9880d681SAndroid Build Coastguard Worker                                    node:$addr),
507*9880d681SAndroid Build Coastguard Worker                    [{ return storeLoadCanUseBlockBinary(N, 1); }]>;
508*9880d681SAndroid Build Coastguard Worker}
509*9880d681SAndroid Build Coastguard Workerdefm block_and : block_op<and>;
510*9880d681SAndroid Build Coastguard Workerdefm block_or  : block_op<or>;
511*9880d681SAndroid Build Coastguard Workerdefm block_xor : block_op<xor>;
512*9880d681SAndroid Build Coastguard Worker
513*9880d681SAndroid Build Coastguard Worker// Insertions.
514*9880d681SAndroid Build Coastguard Workerdef inserti8 : PatFrag<(ops node:$src1, node:$src2),
515*9880d681SAndroid Build Coastguard Worker                       (or (and node:$src1, -256), node:$src2)>;
516*9880d681SAndroid Build Coastguard Workerdef insertll : PatFrag<(ops node:$src1, node:$src2),
517*9880d681SAndroid Build Coastguard Worker                       (or (and node:$src1, 0xffffffffffff0000), node:$src2)>;
518*9880d681SAndroid Build Coastguard Workerdef insertlh : PatFrag<(ops node:$src1, node:$src2),
519*9880d681SAndroid Build Coastguard Worker                       (or (and node:$src1, 0xffffffff0000ffff), node:$src2)>;
520*9880d681SAndroid Build Coastguard Workerdef inserthl : PatFrag<(ops node:$src1, node:$src2),
521*9880d681SAndroid Build Coastguard Worker                       (or (and node:$src1, 0xffff0000ffffffff), node:$src2)>;
522*9880d681SAndroid Build Coastguard Workerdef inserthh : PatFrag<(ops node:$src1, node:$src2),
523*9880d681SAndroid Build Coastguard Worker                       (or (and node:$src1, 0x0000ffffffffffff), node:$src2)>;
524*9880d681SAndroid Build Coastguard Workerdef insertlf : PatFrag<(ops node:$src1, node:$src2),
525*9880d681SAndroid Build Coastguard Worker                       (or (and node:$src1, 0xffffffff00000000), node:$src2)>;
526*9880d681SAndroid Build Coastguard Workerdef inserthf : PatFrag<(ops node:$src1, node:$src2),
527*9880d681SAndroid Build Coastguard Worker                       (or (and node:$src1, 0x00000000ffffffff), node:$src2)>;
528*9880d681SAndroid Build Coastguard Worker
529*9880d681SAndroid Build Coastguard Worker// ORs that can be treated as insertions.
530*9880d681SAndroid Build Coastguard Workerdef or_as_inserti8 : PatFrag<(ops node:$src1, node:$src2),
531*9880d681SAndroid Build Coastguard Worker                             (or node:$src1, node:$src2), [{
532*9880d681SAndroid Build Coastguard Worker  unsigned BitWidth = N->getValueType(0).getScalarType().getSizeInBits();
533*9880d681SAndroid Build Coastguard Worker  return CurDAG->MaskedValueIsZero(N->getOperand(0),
534*9880d681SAndroid Build Coastguard Worker                                   APInt::getLowBitsSet(BitWidth, 8));
535*9880d681SAndroid Build Coastguard Worker}]>;
536*9880d681SAndroid Build Coastguard Worker
537*9880d681SAndroid Build Coastguard Worker// ORs that can be treated as reversed insertions.
538*9880d681SAndroid Build Coastguard Workerdef or_as_revinserti8 : PatFrag<(ops node:$src1, node:$src2),
539*9880d681SAndroid Build Coastguard Worker                                (or node:$src1, node:$src2), [{
540*9880d681SAndroid Build Coastguard Worker  unsigned BitWidth = N->getValueType(0).getScalarType().getSizeInBits();
541*9880d681SAndroid Build Coastguard Worker  return CurDAG->MaskedValueIsZero(N->getOperand(1),
542*9880d681SAndroid Build Coastguard Worker                                   APInt::getLowBitsSet(BitWidth, 8));
543*9880d681SAndroid Build Coastguard Worker}]>;
544*9880d681SAndroid Build Coastguard Worker
545*9880d681SAndroid Build Coastguard Worker// Negative integer absolute.
546*9880d681SAndroid Build Coastguard Workerdef z_inegabs : PatFrag<(ops node:$src), (ineg (z_iabs node:$src))>;
547*9880d681SAndroid Build Coastguard Worker
548*9880d681SAndroid Build Coastguard Worker// Integer absolute, matching the canonical form generated by DAGCombiner.
549*9880d681SAndroid Build Coastguard Workerdef z_iabs32 : PatFrag<(ops node:$src),
550*9880d681SAndroid Build Coastguard Worker                       (xor (add node:$src, (sra node:$src, (i32 31))),
551*9880d681SAndroid Build Coastguard Worker                            (sra node:$src, (i32 31)))>;
552*9880d681SAndroid Build Coastguard Workerdef z_iabs64 : PatFrag<(ops node:$src),
553*9880d681SAndroid Build Coastguard Worker                       (xor (add node:$src, (sra node:$src, (i32 63))),
554*9880d681SAndroid Build Coastguard Worker                            (sra node:$src, (i32 63)))>;
555*9880d681SAndroid Build Coastguard Workerdef z_inegabs32 : PatFrag<(ops node:$src), (ineg (z_iabs32 node:$src))>;
556*9880d681SAndroid Build Coastguard Workerdef z_inegabs64 : PatFrag<(ops node:$src), (ineg (z_iabs64 node:$src))>;
557*9880d681SAndroid Build Coastguard Worker
558*9880d681SAndroid Build Coastguard Worker// Integer multiply-and-add
559*9880d681SAndroid Build Coastguard Workerdef z_muladd : PatFrag<(ops node:$src1, node:$src2, node:$src3),
560*9880d681SAndroid Build Coastguard Worker                       (add (mul node:$src1, node:$src2), node:$src3)>;
561*9880d681SAndroid Build Coastguard Worker
562*9880d681SAndroid Build Coastguard Worker// Fused multiply-subtract, using the natural operand order.
563*9880d681SAndroid Build Coastguard Workerdef fms : PatFrag<(ops node:$src1, node:$src2, node:$src3),
564*9880d681SAndroid Build Coastguard Worker                  (fma node:$src1, node:$src2, (fneg node:$src3))>;
565*9880d681SAndroid Build Coastguard Worker
566*9880d681SAndroid Build Coastguard Worker// Fused multiply-add and multiply-subtract, but with the order of the
567*9880d681SAndroid Build Coastguard Worker// operands matching SystemZ's MA and MS instructions.
568*9880d681SAndroid Build Coastguard Workerdef z_fma : PatFrag<(ops node:$src1, node:$src2, node:$src3),
569*9880d681SAndroid Build Coastguard Worker                    (fma node:$src2, node:$src3, node:$src1)>;
570*9880d681SAndroid Build Coastguard Workerdef z_fms : PatFrag<(ops node:$src1, node:$src2, node:$src3),
571*9880d681SAndroid Build Coastguard Worker                    (fma node:$src2, node:$src3, (fneg node:$src1))>;
572*9880d681SAndroid Build Coastguard Worker
573*9880d681SAndroid Build Coastguard Worker// Floating-point negative absolute.
574*9880d681SAndroid Build Coastguard Workerdef fnabs : PatFrag<(ops node:$ptr), (fneg (fabs node:$ptr))>;
575*9880d681SAndroid Build Coastguard Worker
576*9880d681SAndroid Build Coastguard Worker// Create a unary operator that loads from memory and then performs
577*9880d681SAndroid Build Coastguard Worker// the given operation on it.
578*9880d681SAndroid Build Coastguard Workerclass loadu<SDPatternOperator operator, SDPatternOperator load = load>
579*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$addr), (operator (load node:$addr))>;
580*9880d681SAndroid Build Coastguard Worker
581*9880d681SAndroid Build Coastguard Worker// Create a store operator that performs the given unary operation
582*9880d681SAndroid Build Coastguard Worker// on the value before storing it.
583*9880d681SAndroid Build Coastguard Workerclass storeu<SDPatternOperator operator, SDPatternOperator store = store>
584*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$value, node:$addr),
585*9880d681SAndroid Build Coastguard Worker            (store (operator node:$value), node:$addr)>;
586*9880d681SAndroid Build Coastguard Worker
587*9880d681SAndroid Build Coastguard Worker// Vector representation of all-zeros and all-ones.
588*9880d681SAndroid Build Coastguard Workerdef z_vzero : PatFrag<(ops), (bitconvert (v16i8 (z_byte_mask (i32 0))))>;
589*9880d681SAndroid Build Coastguard Workerdef z_vones : PatFrag<(ops), (bitconvert (v16i8 (z_byte_mask (i32 65535))))>;
590*9880d681SAndroid Build Coastguard Worker
591*9880d681SAndroid Build Coastguard Worker// Load a scalar and replicate it in all elements of a vector.
592*9880d681SAndroid Build Coastguard Workerclass z_replicate_load<ValueType scalartype, SDPatternOperator load>
593*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$addr),
594*9880d681SAndroid Build Coastguard Worker            (z_replicate (scalartype (load node:$addr)))>;
595*9880d681SAndroid Build Coastguard Workerdef z_replicate_loadi8  : z_replicate_load<i32, anyextloadi8>;
596*9880d681SAndroid Build Coastguard Workerdef z_replicate_loadi16 : z_replicate_load<i32, anyextloadi16>;
597*9880d681SAndroid Build Coastguard Workerdef z_replicate_loadi32 : z_replicate_load<i32, load>;
598*9880d681SAndroid Build Coastguard Workerdef z_replicate_loadi64 : z_replicate_load<i64, load>;
599*9880d681SAndroid Build Coastguard Workerdef z_replicate_loadf32 : z_replicate_load<f32, load>;
600*9880d681SAndroid Build Coastguard Workerdef z_replicate_loadf64 : z_replicate_load<f64, load>;
601*9880d681SAndroid Build Coastguard Worker
602*9880d681SAndroid Build Coastguard Worker// Load a scalar and insert it into a single element of a vector.
603*9880d681SAndroid Build Coastguard Workerclass z_vle<ValueType scalartype, SDPatternOperator load>
604*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$vec, node:$addr, node:$index),
605*9880d681SAndroid Build Coastguard Worker            (z_vector_insert node:$vec, (scalartype (load node:$addr)),
606*9880d681SAndroid Build Coastguard Worker                             node:$index)>;
607*9880d681SAndroid Build Coastguard Workerdef z_vlei8  : z_vle<i32, anyextloadi8>;
608*9880d681SAndroid Build Coastguard Workerdef z_vlei16 : z_vle<i32, anyextloadi16>;
609*9880d681SAndroid Build Coastguard Workerdef z_vlei32 : z_vle<i32, load>;
610*9880d681SAndroid Build Coastguard Workerdef z_vlei64 : z_vle<i64, load>;
611*9880d681SAndroid Build Coastguard Workerdef z_vlef32 : z_vle<f32, load>;
612*9880d681SAndroid Build Coastguard Workerdef z_vlef64 : z_vle<f64, load>;
613*9880d681SAndroid Build Coastguard Worker
614*9880d681SAndroid Build Coastguard Worker// Load a scalar and insert it into the low element of the high i64 of a
615*9880d681SAndroid Build Coastguard Worker// zeroed vector.
616*9880d681SAndroid Build Coastguard Workerclass z_vllez<ValueType scalartype, SDPatternOperator load, int index>
617*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$addr),
618*9880d681SAndroid Build Coastguard Worker            (z_vector_insert (z_vzero),
619*9880d681SAndroid Build Coastguard Worker                             (scalartype (load node:$addr)), (i32 index))>;
620*9880d681SAndroid Build Coastguard Workerdef z_vllezi8  : z_vllez<i32, anyextloadi8, 7>;
621*9880d681SAndroid Build Coastguard Workerdef z_vllezi16 : z_vllez<i32, anyextloadi16, 3>;
622*9880d681SAndroid Build Coastguard Workerdef z_vllezi32 : z_vllez<i32, load, 1>;
623*9880d681SAndroid Build Coastguard Workerdef z_vllezi64 : PatFrag<(ops node:$addr),
624*9880d681SAndroid Build Coastguard Worker                         (z_join_dwords (i64 (load node:$addr)), (i64 0))>;
625*9880d681SAndroid Build Coastguard Worker// We use high merges to form a v4f32 from four f32s.  Propagating zero
626*9880d681SAndroid Build Coastguard Worker// into all elements but index 1 gives this expression.
627*9880d681SAndroid Build Coastguard Workerdef z_vllezf32 : PatFrag<(ops node:$addr),
628*9880d681SAndroid Build Coastguard Worker                         (bitconvert
629*9880d681SAndroid Build Coastguard Worker                          (z_merge_high
630*9880d681SAndroid Build Coastguard Worker                           (v2i64
631*9880d681SAndroid Build Coastguard Worker                            (z_unpackl_high
632*9880d681SAndroid Build Coastguard Worker                             (v4i32
633*9880d681SAndroid Build Coastguard Worker                              (bitconvert
634*9880d681SAndroid Build Coastguard Worker                               (v4f32 (scalar_to_vector
635*9880d681SAndroid Build Coastguard Worker                                       (f32 (load node:$addr)))))))),
636*9880d681SAndroid Build Coastguard Worker                           (v2i64 (z_vzero))))>;
637*9880d681SAndroid Build Coastguard Workerdef z_vllezf64 : PatFrag<(ops node:$addr),
638*9880d681SAndroid Build Coastguard Worker                         (z_merge_high
639*9880d681SAndroid Build Coastguard Worker                          (scalar_to_vector (f64 (load node:$addr))),
640*9880d681SAndroid Build Coastguard Worker                          (z_vzero))>;
641*9880d681SAndroid Build Coastguard Worker
642*9880d681SAndroid Build Coastguard Worker// Store one element of a vector.
643*9880d681SAndroid Build Coastguard Workerclass z_vste<ValueType scalartype, SDPatternOperator store>
644*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$vec, node:$addr, node:$index),
645*9880d681SAndroid Build Coastguard Worker            (store (scalartype (z_vector_extract node:$vec, node:$index)),
646*9880d681SAndroid Build Coastguard Worker                   node:$addr)>;
647*9880d681SAndroid Build Coastguard Workerdef z_vstei8  : z_vste<i32, truncstorei8>;
648*9880d681SAndroid Build Coastguard Workerdef z_vstei16 : z_vste<i32, truncstorei16>;
649*9880d681SAndroid Build Coastguard Workerdef z_vstei32 : z_vste<i32, store>;
650*9880d681SAndroid Build Coastguard Workerdef z_vstei64 : z_vste<i64, store>;
651*9880d681SAndroid Build Coastguard Workerdef z_vstef32 : z_vste<f32, store>;
652*9880d681SAndroid Build Coastguard Workerdef z_vstef64 : z_vste<f64, store>;
653*9880d681SAndroid Build Coastguard Worker
654*9880d681SAndroid Build Coastguard Worker// Arithmetic negation on vectors.
655*9880d681SAndroid Build Coastguard Workerdef z_vneg : PatFrag<(ops node:$x), (sub (z_vzero), node:$x)>;
656*9880d681SAndroid Build Coastguard Worker
657*9880d681SAndroid Build Coastguard Worker// Bitwise negation on vectors.
658*9880d681SAndroid Build Coastguard Workerdef z_vnot : PatFrag<(ops node:$x), (xor node:$x, (z_vones))>;
659*9880d681SAndroid Build Coastguard Worker
660*9880d681SAndroid Build Coastguard Worker// Signed "integer greater than zero" on vectors.
661*9880d681SAndroid Build Coastguard Workerdef z_vicmph_zero : PatFrag<(ops node:$x), (z_vicmph node:$x, (z_vzero))>;
662*9880d681SAndroid Build Coastguard Worker
663*9880d681SAndroid Build Coastguard Worker// Signed "integer less than zero" on vectors.
664*9880d681SAndroid Build Coastguard Workerdef z_vicmpl_zero : PatFrag<(ops node:$x), (z_vicmph (z_vzero), node:$x)>;
665*9880d681SAndroid Build Coastguard Worker
666*9880d681SAndroid Build Coastguard Worker// Integer absolute on vectors.
667*9880d681SAndroid Build Coastguard Workerclass z_viabs<int shift>
668*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$src),
669*9880d681SAndroid Build Coastguard Worker            (xor (add node:$src, (z_vsra_by_scalar node:$src, (i32 shift))),
670*9880d681SAndroid Build Coastguard Worker                 (z_vsra_by_scalar node:$src, (i32 shift)))>;
671*9880d681SAndroid Build Coastguard Workerdef z_viabs8  : z_viabs<7>;
672*9880d681SAndroid Build Coastguard Workerdef z_viabs16 : z_viabs<15>;
673*9880d681SAndroid Build Coastguard Workerdef z_viabs32 : z_viabs<31>;
674*9880d681SAndroid Build Coastguard Workerdef z_viabs64 : z_viabs<63>;
675*9880d681SAndroid Build Coastguard Worker
676*9880d681SAndroid Build Coastguard Worker// Sign-extend the i64 elements of a vector.
677*9880d681SAndroid Build Coastguard Workerclass z_vse<int shift>
678*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$src),
679*9880d681SAndroid Build Coastguard Worker            (z_vsra_by_scalar (z_vshl_by_scalar node:$src, shift), shift)>;
680*9880d681SAndroid Build Coastguard Workerdef z_vsei8  : z_vse<56>;
681*9880d681SAndroid Build Coastguard Workerdef z_vsei16 : z_vse<48>;
682*9880d681SAndroid Build Coastguard Workerdef z_vsei32 : z_vse<32>;
683*9880d681SAndroid Build Coastguard Worker
684*9880d681SAndroid Build Coastguard Worker// ...and again with the extensions being done on individual i64 scalars.
685*9880d681SAndroid Build Coastguard Workerclass z_vse_by_parts<SDPatternOperator operator, int index1, int index2>
686*9880d681SAndroid Build Coastguard Worker  : PatFrag<(ops node:$src),
687*9880d681SAndroid Build Coastguard Worker            (z_join_dwords
688*9880d681SAndroid Build Coastguard Worker             (operator (z_vector_extract node:$src, index1)),
689*9880d681SAndroid Build Coastguard Worker             (operator (z_vector_extract node:$src, index2)))>;
690*9880d681SAndroid Build Coastguard Workerdef z_vsei8_by_parts  : z_vse_by_parts<sext8dbl, 7, 15>;
691*9880d681SAndroid Build Coastguard Workerdef z_vsei16_by_parts : z_vse_by_parts<sext16dbl, 3, 7>;
692*9880d681SAndroid Build Coastguard Workerdef z_vsei32_by_parts : z_vse_by_parts<sext32, 1, 3>;
693