blob: 6bcd4993672be1f9d78b735209292487892b89d2 [file] [log] [blame]
Anton Korobeynikovf2e14752009-05-29 23:41:08 +00001//===- ARMInstrThumb2.td - Thumb2 support for ARM -------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file describes the Thumb2 instruction set.
11//
12//===----------------------------------------------------------------------===//
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000013
14// Shifted operands. No register controlled shifts for Thumb2.
15// Note: We do not support rrx shifted operands yet.
16def t2_so_reg : Operand<i32>, // reg imm
Evan Cheng19bb7c72009-06-27 02:26:13 +000017 ComplexPattern<i32, 2, "SelectT2ShifterOperandReg",
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000018 [shl,srl,sra,rotr]> {
Evan Cheng19bb7c72009-06-27 02:26:13 +000019 let PrintMethod = "printT2SOOperand";
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000020 let MIOperandInfo = (ops GPR, i32imm);
21}
22
Evan Cheng36173712009-06-23 17:48:47 +000023// t2_so_imm_XFORM - Return a t2_so_imm value packed into the format
24// described for t2_so_imm def below.
25def t2_so_imm_XFORM : SDNodeXForm<imm, [{
26 return CurDAG->getTargetConstant(
27 ARM_AM::getT2SOImmVal(N->getZExtValue()), MVT::i32);
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000028}]>;
29
Evan Cheng36173712009-06-23 17:48:47 +000030// t2_so_imm_not_XFORM - Return the complement of a t2_so_imm value
31def t2_so_imm_not_XFORM : SDNodeXForm<imm, [{
32 return CurDAG->getTargetConstant(
33 ARM_AM::getT2SOImmVal(~((uint32_t)N->getZExtValue())), MVT::i32);
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000034}]>;
35
Evan Cheng36173712009-06-23 17:48:47 +000036// t2_so_imm_neg_XFORM - Return the negation of a t2_so_imm value
37def t2_so_imm_neg_XFORM : SDNodeXForm<imm, [{
38 return CurDAG->getTargetConstant(
39 ARM_AM::getT2SOImmVal(-((int)N->getZExtValue())), MVT::i32);
40}]>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000041
Evan Cheng36173712009-06-23 17:48:47 +000042// t2_so_imm - Match a 32-bit immediate operand, which is an
43// 8-bit immediate rotated by an arbitrary number of bits, or an 8-bit
44// immediate splatted into multiple bytes of the word. t2_so_imm values are
45// represented in the imm field in the same 12-bit form that they are encoded
46// into t2_so_imm instructions: the 8-bit immediate is the least significant bits
47// [bits 0-7], the 4-bit shift/splat amount is the next 4 bits [bits 8-11].
48def t2_so_imm : Operand<i32>,
49 PatLeaf<(imm), [{
50 return ARM_AM::getT2SOImmVal((uint32_t)N->getZExtValue()) != -1;
51 }], t2_so_imm_XFORM> {
52 let PrintMethod = "printT2SOImmOperand";
53}
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000054
Evan Cheng36173712009-06-23 17:48:47 +000055// t2_so_imm_not - Match an immediate that is a complement
56// of a t2_so_imm.
57def t2_so_imm_not : Operand<i32>,
58 PatLeaf<(imm), [{
59 return ARM_AM::getT2SOImmVal(~((uint32_t)N->getZExtValue())) != -1;
60 }], t2_so_imm_not_XFORM> {
61 let PrintMethod = "printT2SOImmOperand";
62}
63
64// t2_so_imm_neg - Match an immediate that is a negation of a t2_so_imm.
65def t2_so_imm_neg : Operand<i32>,
66 PatLeaf<(imm), [{
67 return ARM_AM::getT2SOImmVal(-((int)N->getZExtValue())) != -1;
68 }], t2_so_imm_neg_XFORM> {
69 let PrintMethod = "printT2SOImmOperand";
70}
71
Evan Chengf7f986d2009-06-23 19:39:13 +000072/// imm1_31 predicate - True if the 32-bit immediate is in the range [1,31].
73def imm1_31 : PatLeaf<(i32 imm), [{
74 return (int32_t)N->getZExtValue() >= 1 && (int32_t)N->getZExtValue() < 32;
75}]>;
76
Evan Cheng36173712009-06-23 17:48:47 +000077/// imm0_4095 predicate - True if the 32-bit immediate is in the range [0.4095].
78def imm0_4095 : PatLeaf<(i32 imm), [{
79 return (uint32_t)N->getZExtValue() < 4096;
80}]>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000081
82def imm0_4095_neg : PatLeaf<(i32 imm), [{
Evan Cheng36173712009-06-23 17:48:47 +000083 return (uint32_t)(-N->getZExtValue()) < 4096;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000084}], imm_neg_XFORM>;
85
Evan Cheng36173712009-06-23 17:48:47 +000086/// imm0_65535 predicate - True if the 32-bit immediate is in the range
87/// [0.65535].
88def imm0_65535 : PatLeaf<(i32 imm), [{
89 return (uint32_t)N->getZExtValue() < 65536;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +000090}]>;
91
92
Evan Cheng36173712009-06-23 17:48:47 +000093/// bf_inv_mask_imm predicate - An AND mask to clear an arbitrary width bitfield
94/// e.g., 0xf000ffff
95def bf_inv_mask_imm : Operand<i32>,
96 PatLeaf<(imm), [{
97 uint32_t v = (uint32_t)N->getZExtValue();
98 if (v == 0xffffffff)
99 return 0;
100 // naive checker. should do better, but simple is best for now since it's
101 // more likely to be correct.
102 while (v & 1) v >>= 1; // shift off the leading 1's
103 if (v)
104 {
105 while (!(v & 1)) v >>=1; // shift off the mask
106 while (v & 1) v >>= 1; // shift off the trailing 1's
107 }
108 // if this is a mask for clearing a bitfield, what's left should be zero.
109 return (v == 0);
110}] > {
111 let PrintMethod = "printBitfieldInvMaskImmOperand";
112}
113
114/// Split a 32-bit immediate into two 16 bit parts.
115def t2_lo16 : SDNodeXForm<imm, [{
116 return CurDAG->getTargetConstant((uint32_t)N->getZExtValue() & 0xffff,
117 MVT::i32);
118}]>;
119
120def t2_hi16 : SDNodeXForm<imm, [{
121 return CurDAG->getTargetConstant((uint32_t)N->getZExtValue() >> 16, MVT::i32);
122}]>;
123
124def t2_lo16AllZero : PatLeaf<(i32 imm), [{
125 // Returns true if all low 16-bits are 0.
126 return (((uint32_t)N->getZExtValue()) & 0xFFFFUL) == 0;
127 }], t2_hi16>;
128
Evan Cheng19bb7c72009-06-27 02:26:13 +0000129
Evan Cheng532cdc52009-06-29 07:51:04 +0000130// Define Thumb2 specific addressing modes.
131
132// t2addrmode_imm12 := reg + imm12
133def t2addrmode_imm12 : Operand<i32>,
134 ComplexPattern<i32, 2, "SelectT2AddrModeImm12", []> {
135 let PrintMethod = "printT2AddrModeImm12Operand";
136 let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm);
137}
138
139// t2addrmode_imm8 := reg - imm8
140def t2addrmode_imm8 : Operand<i32>,
141 ComplexPattern<i32, 2, "SelectT2AddrModeImm8", []> {
142 let PrintMethod = "printT2AddrModeImm8Operand";
143 let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm);
144}
145
146// t2addrmode_so_reg := reg + reg << imm2
147def t2addrmode_so_reg : Operand<i32>,
148 ComplexPattern<i32, 3, "SelectT2AddrModeSoReg", []> {
149 let PrintMethod = "printT2AddrModeSoRegOperand";
150 let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm);
151}
152
153
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000154//===----------------------------------------------------------------------===//
Evan Cheng19bb7c72009-06-27 02:26:13 +0000155// Multiclass helpers...
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000156//
157
Evan Chengf7f986d2009-06-23 19:39:13 +0000158/// T2I_un_irs - Defines a set of (op reg, {so_imm|r|so_reg}) patterns for a
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000159/// unary operation that produces a value. These are predicable and can be
160/// changed to modify CPSR.
Evan Chengf7f986d2009-06-23 19:39:13 +0000161multiclass T2I_un_irs<string opc, PatFrag opnode, bit Cheap = 0, bit ReMat = 0>{
162 // shifted imm
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000163 def i : T2sI<(outs GPR:$dst), (ins t2_so_imm:$src),
164 opc, " $dst, $src",
Evan Chengf7f986d2009-06-23 19:39:13 +0000165 [(set GPR:$dst, (opnode t2_so_imm:$src))]> {
166 let isAsCheapAsAMove = Cheap;
167 let isReMaterializable = ReMat;
168 }
169 // register
170 def r : T2I<(outs GPR:$dst), (ins GPR:$src),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000171 opc, " $dst, $src",
Evan Chengf7f986d2009-06-23 19:39:13 +0000172 [(set GPR:$dst, (opnode GPR:$src))]>;
173 // shifted register
174 def s : T2I<(outs GPR:$dst), (ins t2_so_reg:$src),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000175 opc, " $dst, $src",
176 [(set GPR:$dst, (opnode t2_so_reg:$src))]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000177}
178
179/// T2I_bin_irs - Defines a set of (op reg, {so_imm|r|so_reg}) patterns for a
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000180// binary operation that produces a value. These are predicable and can be
181/// changed to modify CPSR.
Evan Chengbdd679a2009-06-26 00:19:44 +0000182multiclass T2I_bin_irs<string opc, PatFrag opnode, bit Commutable = 0> {
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000183 // shifted imm
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000184 def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
185 opc, " $dst, $lhs, $rhs",
186 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000187 // register
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000188 def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
189 opc, " $dst, $lhs, $rhs",
Evan Chengbdd679a2009-06-26 00:19:44 +0000190 [(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
191 let isCommutable = Commutable;
192 }
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000193 // shifted register
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000194 def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
195 opc, " $dst, $lhs, $rhs",
196 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000197}
198
Evan Chengd4e2f052009-06-25 20:59:23 +0000199/// T2I_rbin_is - Same as T2I_bin_irs except the order of operands are
200/// reversed. It doesn't define the 'rr' form since it's handled by its
201/// T2I_bin_irs counterpart.
202multiclass T2I_rbin_is<string opc, PatFrag opnode> {
Evan Cheng36173712009-06-23 17:48:47 +0000203 // shifted imm
204 def ri : T2I<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000205 opc, " $dst, $rhs, $lhs",
Evan Cheng36173712009-06-23 17:48:47 +0000206 [(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>;
207 // shifted register
208 def rs : T2I<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000209 opc, " $dst, $rhs, $lhs",
Evan Cheng36173712009-06-23 17:48:47 +0000210 [(set GPR:$dst, (opnode t2_so_reg:$lhs, GPR:$rhs))]>;
211}
212
Evan Chengf7f986d2009-06-23 19:39:13 +0000213/// T2I_bin_s_irs - Similar to T2I_bin_irs except it sets the 's' bit so the
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000214/// instruction modifies the CPSR register.
215let Defs = [CPSR] in {
Evan Chengbdd679a2009-06-26 00:19:44 +0000216multiclass T2I_bin_s_irs<string opc, PatFrag opnode, bit Commutable = 0> {
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000217 // shifted imm
Evan Cheng36173712009-06-23 17:48:47 +0000218 def ri : T2I<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000219 !strconcat(opc, "s"), " $dst, $lhs, $rhs",
Evan Cheng36173712009-06-23 17:48:47 +0000220 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000221 // register
222 def rr : T2I<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000223 !strconcat(opc, "s"), " $dst, $lhs, $rhs",
Evan Chengbdd679a2009-06-26 00:19:44 +0000224 [(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
225 let isCommutable = Commutable;
226 }
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000227 // shifted register
Evan Cheng36173712009-06-23 17:48:47 +0000228 def rs : T2I<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000229 !strconcat(opc, "s"), " $dst, $lhs, $rhs",
Evan Cheng36173712009-06-23 17:48:47 +0000230 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000231}
232}
233
Evan Chengf7f986d2009-06-23 19:39:13 +0000234/// T2I_bin_ii12rs - Defines a set of (op reg, {so_imm|imm0_4095|r|so_reg})
235/// patterns for a binary operation that produces a value.
Evan Chengbdd679a2009-06-26 00:19:44 +0000236multiclass T2I_bin_ii12rs<string opc, PatFrag opnode, bit Commutable = 0> {
Evan Cheng36173712009-06-23 17:48:47 +0000237 // shifted imm
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000238 def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
239 opc, " $dst, $lhs, $rhs",
240 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>;
Evan Cheng36173712009-06-23 17:48:47 +0000241 // 12-bit imm
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000242 def ri12 : T2sI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
243 !strconcat(opc, "w"), " $dst, $lhs, $rhs",
244 [(set GPR:$dst, (opnode GPR:$lhs, imm0_4095:$rhs))]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000245 // register
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000246 def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
247 opc, " $dst, $lhs, $rhs",
Evan Chengbdd679a2009-06-26 00:19:44 +0000248 [(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
249 let isCommutable = Commutable;
250 }
Evan Cheng36173712009-06-23 17:48:47 +0000251 // shifted register
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000252 def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
253 opc, " $dst, $lhs, $rhs",
254 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
Evan Cheng36173712009-06-23 17:48:47 +0000255}
256
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000257/// T2I_adde_sube_irs - Defines a set of (op reg, {so_imm|r|so_reg}) patterns for a
Evan Chengd4e2f052009-06-25 20:59:23 +0000258/// binary operation that produces a value and use and define the carry bit.
259/// It's not predicable.
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000260let Uses = [CPSR] in {
Evan Chengbdd679a2009-06-26 00:19:44 +0000261multiclass T2I_adde_sube_irs<string opc, PatFrag opnode, bit Commutable = 0> {
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000262 // shifted imm
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000263 def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
David Goodwin3536d172009-06-26 20:45:56 +0000264 opc, " $dst, $lhs, $rhs",
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000265 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>,
266 Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000267 // register
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000268 def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
David Goodwin3536d172009-06-26 20:45:56 +0000269 opc, " $dst, $lhs, $rhs",
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000270 [(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>,
Evan Chengbdd679a2009-06-26 00:19:44 +0000271 Requires<[IsThumb, HasThumb2, CarryDefIsUnused]> {
272 let isCommutable = Commutable;
273 }
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000274 // shifted register
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000275 def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
David Goodwin3536d172009-06-26 20:45:56 +0000276 opc, " $dst, $lhs, $rhs",
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000277 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>,
278 Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>;
279 // Carry setting variants
280 // shifted imm
281 def Sri : T2XI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
282 !strconcat(opc, "s $dst, $lhs, $rhs"),
283 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>,
284 Requires<[IsThumb, HasThumb2, CarryDefIsUsed]> {
285 let Defs = [CPSR];
286 }
287 // register
288 def Srr : T2XI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
289 !strconcat(opc, "s $dst, $lhs, $rhs"),
290 [(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>,
291 Requires<[IsThumb, HasThumb2, CarryDefIsUsed]> {
292 let Defs = [CPSR];
Evan Chengbdd679a2009-06-26 00:19:44 +0000293 let isCommutable = Commutable;
294 }
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000295 // shifted register
296 def Srs : T2XI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
297 !strconcat(opc, "s $dst, $lhs, $rhs"),
298 [(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>,
299 Requires<[IsThumb, HasThumb2, CarryDefIsUsed]> {
300 let Defs = [CPSR];
Evan Chengbdd679a2009-06-26 00:19:44 +0000301 }
Evan Cheng36173712009-06-23 17:48:47 +0000302}
303}
304
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000305/// T2I_rsc_is - Same as T2I_adde_sube_irs except the order of operands are
Evan Chengd4e2f052009-06-25 20:59:23 +0000306/// reversed. It doesn't define the 'rr' form since it's handled by its
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000307/// T2I_adde_sube_irs counterpart.
Evan Chengd4e2f052009-06-25 20:59:23 +0000308let Defs = [CPSR], Uses = [CPSR] in {
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000309multiclass T2I_rsc_is<string opc, PatFrag opnode> {
Evan Chengd4e2f052009-06-25 20:59:23 +0000310 // shifted imm
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000311 def ri : T2sI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs),
312 opc, " $dst, $rhs, $lhs",
313 [(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>,
314 Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>;
Evan Chengd4e2f052009-06-25 20:59:23 +0000315 // shifted register
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000316 def rs : T2sI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs),
317 opc, " $dst, $rhs, $lhs",
318 [(set GPR:$dst, (opnode t2_so_reg:$lhs, GPR:$rhs))]>,
319 Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>;
320 // shifted imm
321 def Sri : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs),
Evan Chengd4e2f052009-06-25 20:59:23 +0000322 !strconcat(opc, "s $dst, $rhs, $lhs"),
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000323 [(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>,
324 Requires<[IsThumb, HasThumb2, CarryDefIsUsed]> {
325 let Defs = [CPSR];
Evan Chengbdd679a2009-06-26 00:19:44 +0000326 }
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000327 // shifted register
328 def Srs : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs),
329 !strconcat(opc, "s $dst, $rhs, $lhs"),
330 [(set GPR:$dst, (opnode t2_so_reg:$lhs, GPR:$rhs))]>,
331 Requires<[IsThumb, HasThumb2, CarryDefIsUsed]> {
332 let Defs = [CPSR];
Evan Chengbdd679a2009-06-26 00:19:44 +0000333 }
Evan Chengd4e2f052009-06-25 20:59:23 +0000334}
335}
336
337/// T2I_rbin_s_is - Same as T2I_bin_s_irs except the order of operands are
338/// reversed. It doesn't define the 'rr' form since it's handled by its
339/// T2I_bin_s_irs counterpart.
340let Defs = [CPSR] in {
341multiclass T2I_rbin_s_is<string opc, PatFrag opnode> {
Evan Cheng36173712009-06-23 17:48:47 +0000342 // shifted imm
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000343 def ri : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs, cc_out:$s),
344 !strconcat(opc, "${s} $dst, $rhs, $lhs"),
345 [(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>;
Evan Cheng36173712009-06-23 17:48:47 +0000346 // shifted register
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000347 def rs : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs, cc_out:$s),
348 !strconcat(opc, "${s} $dst, $rhs, $lhs"),
349 [(set GPR:$dst, (opnode t2_so_reg:$lhs, GPR:$rhs))]>;
Evan Cheng36173712009-06-23 17:48:47 +0000350}
351}
352
Evan Chengf7f986d2009-06-23 19:39:13 +0000353/// T2I_sh_ir - Defines a set of (op reg, {so_imm|r}) patterns for a shift /
354// rotate operation that produces a value.
355multiclass T2I_sh_ir<string opc, PatFrag opnode> {
356 // 5-bit imm
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000357 def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
358 opc, " $dst, $lhs, $rhs",
359 [(set GPR:$dst, (opnode GPR:$lhs, imm1_31:$rhs))]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000360 // register
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000361 def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
362 opc, " $dst, $lhs, $rhs",
363 [(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000364}
Evan Cheng36173712009-06-23 17:48:47 +0000365
Evan Chengf7f986d2009-06-23 19:39:13 +0000366/// T21_cmp_irs - Defines a set of (op r, {so_imm|r|so_reg}) cmp / test
367/// patterns. Similar to T2I_bin_irs except the instruction does not produce
Evan Cheng36173712009-06-23 17:48:47 +0000368/// a explicit result, only implicitly set CPSR.
369let Uses = [CPSR] in {
370multiclass T2I_cmp_is<string opc, PatFrag opnode> {
371 // shifted imm
372 def ri : T2I<(outs), (ins GPR:$lhs, t2_so_imm:$rhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000373 opc, " $lhs, $rhs",
Evan Cheng36173712009-06-23 17:48:47 +0000374 [(opnode GPR:$lhs, t2_so_imm:$rhs)]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000375 // register
376 def rr : T2I<(outs), (ins GPR:$lhs, GPR:$rhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000377 opc, " $lhs, $rhs",
Evan Chengf7f986d2009-06-23 19:39:13 +0000378 [(opnode GPR:$lhs, GPR:$rhs)]>;
Evan Cheng36173712009-06-23 17:48:47 +0000379 // shifted register
380 def rs : T2I<(outs), (ins GPR:$lhs, t2_so_reg:$rhs),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000381 opc, " $lhs, $rhs",
Evan Cheng36173712009-06-23 17:48:47 +0000382 [(opnode GPR:$lhs, t2_so_reg:$rhs)]>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000383}
384}
385
386//===----------------------------------------------------------------------===//
Evan Cheng19bb7c72009-06-27 02:26:13 +0000387// Instructions
388//===----------------------------------------------------------------------===//
389
390//===----------------------------------------------------------------------===//
Evan Cheng41799702009-06-24 23:47:58 +0000391// Miscellaneous Instructions.
392//
393
394let isNotDuplicable = 1 in
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000395def t2PICADD : T2XI<(outs tGPR:$dst), (ins tGPR:$lhs, pclabel:$cp),
396 "$cp:\n\tadd $dst, pc",
397 [(set tGPR:$dst, (ARMpic_add tGPR:$lhs, imm:$cp))]>;
Evan Cheng41799702009-06-24 23:47:58 +0000398
399
400// LEApcrel - Load a pc-relative address into a register without offending the
401// assembler.
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000402def t2LEApcrel : T2XI<(outs GPR:$dst), (ins i32imm:$label, pred:$p),
Evan Cheng41799702009-06-24 23:47:58 +0000403 !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(",
404 "${:private}PCRELL${:uid}+8))\n"),
405 !strconcat("${:private}PCRELL${:uid}:\n\t",
406 "add$p $dst, pc, #PCRELV${:uid}")),
407 []>;
408
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000409def t2LEApcrelJT : T2XI<(outs GPR:$dst),
Evan Cheng41799702009-06-24 23:47:58 +0000410 (ins i32imm:$label, i32imm:$id, pred:$p),
411 !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(",
412 "${:private}PCRELL${:uid}+8))\n"),
413 !strconcat("${:private}PCRELL${:uid}:\n\t",
414 "add$p $dst, pc, #PCRELV${:uid}")),
415 []>;
416
Evan Cheng10e82e32009-06-25 01:21:30 +0000417// ADD rd, sp, #so_imm
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000418def t2ADDrSPi : T2XI<(outs GPR:$dst), (ins GPR:$sp, t2_so_imm:$imm),
419 "add $dst, $sp, $imm",
420 []>;
Evan Cheng10e82e32009-06-25 01:21:30 +0000421
422// ADD rd, sp, #imm12
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000423def t2ADDrSPi12 : T2XI<(outs GPR:$dst), (ins GPR:$sp, i32imm:$imm),
424 "addw $dst, $sp, $imm",
425 []>;
Evan Cheng10e82e32009-06-25 01:21:30 +0000426
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000427def t2ADDrSPs : T2XI<(outs GPR:$dst), (ins GPR:$sp, t2_so_reg:$rhs),
428 "addw $dst, $sp, $rhs",
429 []>;
Evan Cheng10e82e32009-06-25 01:21:30 +0000430
431
Evan Cheng41799702009-06-24 23:47:58 +0000432//===----------------------------------------------------------------------===//
Evan Cheng19bb7c72009-06-27 02:26:13 +0000433// Load / store Instructions.
434//
435
Evan Cheng532cdc52009-06-29 07:51:04 +0000436// Load
437let canFoldAsLoad = 1 in {
438def t2LDRi12 : T2Ii12<(outs GPR:$dst), (ins t2addrmode_imm12:$addr),
439 "ldr", " $dst, $addr",
440 [(set GPR:$dst, (load t2addrmode_imm12:$addr))]>;
441
442def t2LDRi8 : T2Ii8<(outs GPR:$dst), (ins t2addrmode_imm8:$addr),
443 "ldr", " $dst, $addr",
444 [(set GPR:$dst, (load t2addrmode_imm8:$addr))]>;
445
446def t2LDRs : T2Iso<(outs GPR:$dst), (ins t2addrmode_so_reg:$addr),
447 "ldr", " $dst, $addr",
448 [(set GPR:$dst, (load t2addrmode_so_reg:$addr))]>;
449
450// Load tconstpool
451def t2LDRpci : T2Ipc<(outs GPR:$dst), (ins i32imm:$addr),
452 "ldr", " $dst, $addr",
453 [(set GPR:$dst, (load (ARMWrapper tconstpool:$addr)))]>;
454} // canFoldAsLoad
455
Evan Cheng19bb7c72009-06-27 02:26:13 +0000456//===----------------------------------------------------------------------===//
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000457// Move Instructions.
458//
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000459
Evan Cheng36173712009-06-23 17:48:47 +0000460let neverHasSideEffects = 1 in
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000461def t2MOVr : T2sI<(outs GPR:$dst), (ins GPR:$src),
462 "mov", " $dst, $src", []>;
Evan Cheng36173712009-06-23 17:48:47 +0000463
Evan Chengf7f986d2009-06-23 19:39:13 +0000464let isReMaterializable = 1, isAsCheapAsAMove = 1 in
David Goodwin2dbffd42009-06-26 16:10:07 +0000465def t2MOVi : T2sI<(outs GPR:$dst), (ins t2_so_imm:$src),
466 "mov", " $dst, $src",
467 [(set GPR:$dst, t2_so_imm:$src)]>;
468
469let isReMaterializable = 1, isAsCheapAsAMove = 1 in
470def t2MOVi16 : T2I<(outs GPR:$dst), (ins i32imm:$src),
471 "movw", " $dst, $src",
472 [(set GPR:$dst, imm0_65535:$src)]>;
Evan Cheng36173712009-06-23 17:48:47 +0000473
Evan Cheng36173712009-06-23 17:48:47 +0000474// FIXME: Also available in ARM mode.
Evan Cheng42e6ce92009-06-23 05:23:49 +0000475let Constraints = "$src = $dst" in
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000476def t2MOVTi16 : T2sI<(outs GPR:$dst), (ins GPR:$src, i32imm:$imm),
477 "movt", " $dst, $imm",
478 [(set GPR:$dst,
479 (or (and GPR:$src, 0xffff), t2_lo16AllZero:$imm))]>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000480
481//===----------------------------------------------------------------------===//
482// Arithmetic Instructions.
483//
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000484
Evan Chengbdd679a2009-06-26 00:19:44 +0000485defm t2ADD : T2I_bin_ii12rs<"add", BinOpFrag<(add node:$LHS, node:$RHS)>, 1>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000486defm t2SUB : T2I_bin_ii12rs<"sub", BinOpFrag<(sub node:$LHS, node:$RHS)>>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000487
Evan Cheng36173712009-06-23 17:48:47 +0000488// ADD and SUB with 's' bit set. No 12-bit immediate (T4) variants.
Evan Chengbdd679a2009-06-26 00:19:44 +0000489defm t2ADDS : T2I_bin_s_irs <"add", BinOpFrag<(addc node:$LHS, node:$RHS)>, 1>;
Evan Chengd4e2f052009-06-25 20:59:23 +0000490defm t2SUBS : T2I_bin_s_irs <"sub", BinOpFrag<(subc node:$LHS, node:$RHS)>>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000491
Evan Chengbdd679a2009-06-26 00:19:44 +0000492defm t2ADC : T2I_adde_sube_irs<"adc",BinOpFrag<(adde node:$LHS, node:$RHS)>,1>;
493defm t2SBC : T2I_adde_sube_irs<"sbc",BinOpFrag<(sube node:$LHS, node:$RHS)>>;
Evan Cheng36173712009-06-23 17:48:47 +0000494
495// RSB, RSC
Evan Chengd4e2f052009-06-25 20:59:23 +0000496defm t2RSB : T2I_rbin_is <"rsb", BinOpFrag<(sub node:$LHS, node:$RHS)>>;
497defm t2RSBS : T2I_rbin_s_is <"rsb", BinOpFrag<(subc node:$LHS, node:$RHS)>>;
Evan Cheng9b4d26f2009-06-25 23:34:10 +0000498defm t2RSC : T2I_rsc_is <"rsc", BinOpFrag<(sube node:$LHS, node:$RHS)>>;
Evan Cheng36173712009-06-23 17:48:47 +0000499
500// (sub X, imm) gets canonicalized to (add X, -imm). Match this form.
Evan Cheng19bb7c72009-06-27 02:26:13 +0000501def : T2Pat<(add GPR:$src, t2_so_imm_neg:$imm),
502 (t2SUBri GPR:$src, t2_so_imm_neg:$imm)>;
503def : T2Pat<(add GPR:$src, imm0_4095_neg:$imm),
504 (t2SUBri12 GPR:$src, imm0_4095_neg:$imm)>;
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000505
506
Evan Cheng36173712009-06-23 17:48:47 +0000507//===----------------------------------------------------------------------===//
Evan Chengf7f986d2009-06-23 19:39:13 +0000508// Shift and rotate Instructions.
509//
510
511defm t2LSL : T2I_sh_ir<"lsl", BinOpFrag<(shl node:$LHS, node:$RHS)>>;
512defm t2LSR : T2I_sh_ir<"lsr", BinOpFrag<(srl node:$LHS, node:$RHS)>>;
513defm t2ASR : T2I_sh_ir<"asr", BinOpFrag<(sra node:$LHS, node:$RHS)>>;
514defm t2ROR : T2I_sh_ir<"ror", BinOpFrag<(rotr node:$LHS, node:$RHS)>>;
515
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000516def t2MOVrx : T2sI<(outs GPR:$dst), (ins GPR:$src),
517 "mov", " $dst, $src, rrx",
518 [(set GPR:$dst, (ARMrrx GPR:$src))]>;
Evan Chengf7f986d2009-06-23 19:39:13 +0000519
520//===----------------------------------------------------------------------===//
Evan Cheng36173712009-06-23 17:48:47 +0000521// Bitwise Instructions.
522//
Anton Korobeynikovac869fc2009-06-17 18:13:58 +0000523
Evan Chengbdd679a2009-06-26 00:19:44 +0000524defm t2AND : T2I_bin_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>, 1>;
525defm t2ORR : T2I_bin_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>, 1>;
526defm t2EOR : T2I_bin_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>, 1>;
Evan Cheng36173712009-06-23 17:48:47 +0000527
Evan Chengf7f986d2009-06-23 19:39:13 +0000528defm t2BIC : T2I_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
Evan Cheng36173712009-06-23 17:48:47 +0000529
Evan Cheng19bb7c72009-06-27 02:26:13 +0000530def : T2Pat<(and GPR:$src, t2_so_imm_not:$imm),
531 (t2BICri GPR:$src, t2_so_imm_not:$imm)>;
Evan Cheng36173712009-06-23 17:48:47 +0000532
Evan Chengf7f986d2009-06-23 19:39:13 +0000533defm t2ORN : T2I_bin_irs<"orn", BinOpFrag<(or node:$LHS, (not node:$RHS))>>;
Evan Cheng36173712009-06-23 17:48:47 +0000534
Evan Cheng19bb7c72009-06-27 02:26:13 +0000535def : T2Pat<(or GPR:$src, t2_so_imm_not:$imm),
536 (t2ORNri GPR:$src, t2_so_imm_not:$imm)>;
Evan Cheng36173712009-06-23 17:48:47 +0000537
David Goodwin4f8708c2009-06-26 23:13:13 +0000538// Prefer over of t2EORri ra, rb, -1 because mvn has 16-bit version
539let AddedComplexity = 1 in
Evan Chengf7f986d2009-06-23 19:39:13 +0000540defm t2MVN : T2I_un_irs <"mvn", UnOpFrag<(not node:$Src)>, 1, 1>;
Evan Cheng36173712009-06-23 17:48:47 +0000541
Evan Cheng19bb7c72009-06-27 02:26:13 +0000542def : T2Pat<(t2_so_imm_not:$src),
543 (t2MVNi t2_so_imm_not:$src)>;
David Goodwindcc21962009-06-25 23:11:21 +0000544
Evan Cheng36173712009-06-23 17:48:47 +0000545// A8.6.17 BFC - Bitfield clear
546// FIXME: Also available in ARM mode.
547let Constraints = "$src = $dst" in
548def t2BFC : T2I<(outs GPR:$dst), (ins GPR:$src, bf_inv_mask_imm:$imm),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000549 "bfc", " $dst, $imm",
Evan Cheng36173712009-06-23 17:48:47 +0000550 [(set GPR:$dst, (and GPR:$src, bf_inv_mask_imm:$imm))]>;
551
552// FIXME: A8.6.18 BFI - Bitfield insert (Encoding T1)
553
554//===----------------------------------------------------------------------===//
555// Multiply Instructions.
556//
Evan Chengbdd679a2009-06-26 00:19:44 +0000557let isCommutable = 1 in
Evan Cheng36173712009-06-23 17:48:47 +0000558def t2MUL: T2I<(outs GPR:$dst), (ins GPR:$a, GPR:$b),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000559 "mul", " $dst, $a, $b",
Evan Cheng36173712009-06-23 17:48:47 +0000560 [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>;
561
562def t2MLA: T2I<(outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000563 "mla", " $dst, $a, $b, $c",
Evan Cheng36173712009-06-23 17:48:47 +0000564 [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>;
565
566def t2MLS: T2I<(outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000567 "mls", " $dst, $a, $b, $c",
Evan Cheng36173712009-06-23 17:48:47 +0000568 [(set GPR:$dst, (sub GPR:$c, (mul GPR:$a, GPR:$b)))]>;
569
570// FIXME: SMULL, etc.
571
572//===----------------------------------------------------------------------===//
573// Misc. Arithmetic Instructions.
574//
575
Evan Cheng36173712009-06-23 17:48:47 +0000576def t2CLZ : T2I<(outs GPR:$dst), (ins GPR:$src),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000577 "clz", " $dst, $src",
Evan Cheng36173712009-06-23 17:48:47 +0000578 [(set GPR:$dst, (ctlz GPR:$src))]>;
579
580def t2REV : T2I<(outs GPR:$dst), (ins GPR:$src),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000581 "rev", " $dst, $src",
Evan Cheng36173712009-06-23 17:48:47 +0000582 [(set GPR:$dst, (bswap GPR:$src))]>;
583
584def t2REV16 : T2I<(outs GPR:$dst), (ins GPR:$src),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000585 "rev16", " $dst, $src",
Evan Cheng36173712009-06-23 17:48:47 +0000586 [(set GPR:$dst,
587 (or (and (srl GPR:$src, (i32 8)), 0xFF),
588 (or (and (shl GPR:$src, (i32 8)), 0xFF00),
589 (or (and (srl GPR:$src, (i32 8)), 0xFF0000),
590 (and (shl GPR:$src, (i32 8)), 0xFF000000)))))]>;
591
592/////
593/// A8.6.137 REVSH
594/////
595def t2REVSH : T2I<(outs GPR:$dst), (ins GPR:$src),
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000596 "revsh", " $dst, $src",
Evan Cheng36173712009-06-23 17:48:47 +0000597 [(set GPR:$dst,
598 (sext_inreg
599 (or (srl (and GPR:$src, 0xFFFF), (i32 8)),
600 (shl GPR:$src, (i32 8))), i16))]>;
601
602// FIXME: PKHxx etc.
603
604//===----------------------------------------------------------------------===//
605// Comparison Instructions...
606//
607
608defm t2CMP : T2I_cmp_is<"cmp",
609 BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>;
David Goodwin8bdcbb32009-06-29 15:33:01 +0000610defm t2CMPz : T2I_cmp_is<"cmp",
611 BinOpFrag<(ARMcmpZ node:$LHS, node:$RHS)>>;
Evan Cheng36173712009-06-23 17:48:47 +0000612
613defm t2CMN : T2I_cmp_is<"cmn",
614 BinOpFrag<(ARMcmp node:$LHS,(ineg node:$RHS))>>;
David Goodwin8bdcbb32009-06-29 15:33:01 +0000615defm t2CMNz : T2I_cmp_is<"cmn",
616 BinOpFrag<(ARMcmpZ node:$LHS,(ineg node:$RHS))>>;
Evan Cheng36173712009-06-23 17:48:47 +0000617
Evan Cheng19bb7c72009-06-27 02:26:13 +0000618def : T2Pat<(ARMcmp GPR:$src, t2_so_imm_neg:$imm),
619 (t2CMNri GPR:$src, t2_so_imm_neg:$imm)>;
Evan Cheng36173712009-06-23 17:48:47 +0000620
David Goodwin8bdcbb32009-06-29 15:33:01 +0000621def : T2Pat<(ARMcmpZ GPR:$src, t2_so_imm_neg:$imm),
Evan Cheng19bb7c72009-06-27 02:26:13 +0000622 (t2CMNri GPR:$src, t2_so_imm_neg:$imm)>;
Evan Cheng36173712009-06-23 17:48:47 +0000623
624// FIXME: TST, TEQ, etc.
625
626// A8.6.27 CBNZ, CBZ - Compare and branch on (non)zero.
627// Short range conditional branch. Looks awesome for loops. Need to figure
628// out how to use this one.
629
630// FIXME: Conditional moves
631
632
633//===----------------------------------------------------------------------===//
634// Non-Instruction Patterns
635//
636
Evan Cheng41799702009-06-24 23:47:58 +0000637// ConstantPool, GlobalAddress, and JumpTable
Evan Cheng19bb7c72009-06-27 02:26:13 +0000638def : T2Pat<(ARMWrapper tglobaladdr :$dst), (t2LEApcrel tglobaladdr :$dst)>;
639def : T2Pat<(ARMWrapper tconstpool :$dst), (t2LEApcrel tconstpool :$dst)>;
640def : T2Pat<(ARMWrapperJT tjumptable:$dst, imm:$id),
641 (t2LEApcrelJT tjumptable:$dst, imm:$id)>;
Evan Cheng41799702009-06-24 23:47:58 +0000642
Evan Cheng36173712009-06-23 17:48:47 +0000643// Large immediate handling.
644
Evan Cheng19bb7c72009-06-27 02:26:13 +0000645def : T2Pat<(i32 imm:$src),
646 (t2MOVTi16 (t2MOVi16 (t2_lo16 imm:$src)), (t2_hi16 imm:$src))>;