blob: 201f65c7f5a7f4923b9e83bcf63d8267e866df1d [file] [log] [blame]
Evan Chenga8e29892007-01-19 07:51:42 +00001//===- ARMInstrInfo.td - Target Description for ARM Target -*- tablegen -*-===//
Rafael Espindola7bc59bc2006-05-14 22:18:28 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the "Instituto Nokia de Tecnologia" and
6// is distributed under the University of Illinois Open Source
7// License. See LICENSE.TXT for details.
8//
9//===----------------------------------------------------------------------===//
10//
11// This file describes the ARM instructions in TableGen format.
12//
13//===----------------------------------------------------------------------===//
14
Evan Chenga8e29892007-01-19 07:51:42 +000015//===----------------------------------------------------------------------===//
16// ARM specific DAG Nodes.
17//
Rafael Espindola7cca7c52006-09-11 17:25:40 +000018
Evan Chenga8e29892007-01-19 07:51:42 +000019// Type profiles.
20def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
Rafael Espindola6e8c6492006-11-08 17:07:32 +000021
Evan Chenga8e29892007-01-19 07:51:42 +000022def SDT_ARMSaveCallPC : SDTypeProfile<0, 1, []>;
Rafael Espindola32bd5f42006-10-17 18:04:53 +000023
Evan Chenga8e29892007-01-19 07:51:42 +000024def SDT_ARMcall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
Rafael Espindola7cca7c52006-09-11 17:25:40 +000025
Evan Chenga8e29892007-01-19 07:51:42 +000026def SDT_ARMCMov : SDTypeProfile<1, 3,
27 [SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>,
28 SDTCisVT<3, i32>]>;
Rafael Espindola6e8c6492006-11-08 17:07:32 +000029
Evan Chenga8e29892007-01-19 07:51:42 +000030def SDT_ARMBrcond : SDTypeProfile<0, 2,
31 [SDTCisVT<0, OtherVT>, SDTCisVT<1, i32>]>;
32
33def SDT_ARMBrJT : SDTypeProfile<0, 3,
34 [SDTCisPtrTy<0>, SDTCisVT<1, i32>,
35 SDTCisVT<2, i32>]>;
36
37def SDT_ARMCmp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>;
38
39def SDT_ARMPICAdd : SDTypeProfile<1, 2, [SDTCisSameAs<0, 1>,
40 SDTCisPtrTy<1>, SDTCisVT<2, i32>]>;
41
42// Node definitions.
43def ARMWrapper : SDNode<"ARMISD::Wrapper", SDTIntUnaryOp>;
Evan Chenga8e29892007-01-19 07:51:42 +000044def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntBinOp>;
45
46def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq,
47 [SDNPHasChain, SDNPOutFlag]>;
48def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq,
Evan Chengb38cba92007-02-03 09:11:58 +000049 [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
Evan Chenga8e29892007-01-19 07:51:42 +000050
51def ARMcall : SDNode<"ARMISD::CALL", SDT_ARMcall,
52 [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
53def ARMcall_nolink : SDNode<"ARMISD::CALL_NOLINK", SDT_ARMcall,
54 [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
55
56def ARMretflag : SDNode<"ARMISD::RET_FLAG", SDTRet,
57 [SDNPHasChain, SDNPOptInFlag]>;
58
59def ARMcmov : SDNode<"ARMISD::CMOV", SDT_ARMCMov,
60 [SDNPInFlag]>;
61def ARMcneg : SDNode<"ARMISD::CNEG", SDT_ARMCMov,
62 [SDNPInFlag]>;
63
64def ARMbrcond : SDNode<"ARMISD::BRCOND", SDT_ARMBrcond,
65 [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
66
67def ARMbrjt : SDNode<"ARMISD::BR_JT", SDT_ARMBrJT,
68 [SDNPHasChain]>;
69
70def ARMcmp : SDNode<"ARMISD::CMP", SDT_ARMCmp,
71 [SDNPOutFlag]>;
72
73def ARMpic_add : SDNode<"ARMISD::PIC_ADD", SDT_ARMPICAdd>;
74
75def ARMsrl_flag : SDNode<"ARMISD::SRL_FLAG", SDTIntUnaryOp, [SDNPOutFlag]>;
76def ARMsra_flag : SDNode<"ARMISD::SRA_FLAG", SDTIntUnaryOp, [SDNPOutFlag]>;
77def ARMrrx : SDNode<"ARMISD::RRX" , SDTIntUnaryOp, [SDNPInFlag ]>;
Rafael Espindola32bd5f42006-10-17 18:04:53 +000078
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000079//===----------------------------------------------------------------------===//
Evan Chenga8e29892007-01-19 07:51:42 +000080// ARM Instruction Predicate Definitions.
81//
82def HasV5T : Predicate<"Subtarget->hasV5TOps()">;
83def HasV5TE : Predicate<"Subtarget->hasV5TEOps()">;
84def HasV6 : Predicate<"Subtarget->hasV6Ops()">;
85def IsThumb : Predicate<"Subtarget->isThumb()">;
86def IsARM : Predicate<"!Subtarget->isThumb()">;
87
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000088//===----------------------------------------------------------------------===//
Evan Chenga8e29892007-01-19 07:51:42 +000089// ARM Flag Definitions.
90
91class RegConstraint<string C> {
92 string Constraints = C;
93}
94
95//===----------------------------------------------------------------------===//
96// ARM specific transformation functions and pattern fragments.
97//
98
99// so_imm_XFORM - Return a so_imm value packed into the format described for
100// so_imm def below.
101def so_imm_XFORM : SDNodeXForm<imm, [{
102 return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(N->getValue()),
103 MVT::i32);
104}]>;
105
106// so_imm_neg_XFORM - Return a so_imm value packed into the format described for
107// so_imm_neg def below.
108def so_imm_neg_XFORM : SDNodeXForm<imm, [{
109 return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(-(int)N->getValue()),
110 MVT::i32);
111}]>;
112
113// so_imm_not_XFORM - Return a so_imm value packed into the format described for
114// so_imm_not def below.
115def so_imm_not_XFORM : SDNodeXForm<imm, [{
116 return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(~(int)N->getValue()),
117 MVT::i32);
118}]>;
119
120// rot_imm predicate - True if the 32-bit immediate is equal to 8, 16, or 24.
121def rot_imm : PatLeaf<(i32 imm), [{
122 int32_t v = (int32_t)N->getValue();
123 return v == 8 || v == 16 || v == 24;
124}]>;
125
126/// imm1_15 predicate - True if the 32-bit immediate is in the range [1,15].
127def imm1_15 : PatLeaf<(i32 imm), [{
128 return (int32_t)N->getValue() >= 1 && (int32_t)N->getValue() < 16;
129}]>;
130
131/// imm16_31 predicate - True if the 32-bit immediate is in the range [16,31].
132def imm16_31 : PatLeaf<(i32 imm), [{
133 return (int32_t)N->getValue() >= 16 && (int32_t)N->getValue() < 32;
134}]>;
135
136def so_imm_neg :
137 PatLeaf<(imm), [{ return ARM_AM::getSOImmVal(-(int)N->getValue()) != -1; }],
138 so_imm_neg_XFORM>;
139
Evan Chenga2515702007-03-19 07:09:02 +0000140def so_imm_not :
Evan Chenga8e29892007-01-19 07:51:42 +0000141 PatLeaf<(imm), [{ return ARM_AM::getSOImmVal(~(int)N->getValue()) != -1; }],
142 so_imm_not_XFORM>;
143
144// sext_16_node predicate - True if the SDNode is sign-extended 16 or more bits.
145def sext_16_node : PatLeaf<(i32 GPR:$a), [{
146 return TLI.ComputeNumSignBits(SDOperand(N,0)) >= 17;
147}]>;
148
149
Evan Chenga8e29892007-01-19 07:51:42 +0000150
151//===----------------------------------------------------------------------===//
152// Operand Definitions.
153//
154
155// Branch target.
156def brtarget : Operand<OtherVT>;
157
158// Operand for printing out a condition code.
159def CCOp : Operand<i32> {
160 let PrintMethod = "printCCOperand";
161}
162
163// A list of registers separated by comma. Used by load/store multiple.
164def reglist : Operand<i32> {
165 let PrintMethod = "printRegisterList";
166}
167
168// An operand for the CONSTPOOL_ENTRY pseudo-instruction.
169def cpinst_operand : Operand<i32> {
170 let PrintMethod = "printCPInstOperand";
171}
172
173def jtblock_operand : Operand<i32> {
174 let PrintMethod = "printJTBlockOperand";
175}
176
177// Local PC labels.
178def pclabel : Operand<i32> {
179 let PrintMethod = "printPCLabel";
180}
181
182// shifter_operand operands: so_reg and so_imm.
183def so_reg : Operand<i32>, // reg reg imm
184 ComplexPattern<i32, 3, "SelectShifterOperandReg",
185 [shl,srl,sra,rotr]> {
186 let PrintMethod = "printSORegOperand";
187 let MIOperandInfo = (ops GPR, GPR, i32imm);
188}
189
190// so_imm - Match a 32-bit shifter_operand immediate operand, which is an
191// 8-bit immediate rotated by an arbitrary number of bits. so_imm values are
192// represented in the imm field in the same 12-bit form that they are encoded
193// into so_imm instructions: the 8-bit immediate is the least significant bits
194// [bits 0-7], the 4-bit shift amount is the next 4 bits [bits 8-11].
195def so_imm : Operand<i32>,
196 PatLeaf<(imm),
197 [{ return ARM_AM::getSOImmVal(N->getValue()) != -1; }],
198 so_imm_XFORM> {
199 let PrintMethod = "printSOImmOperand";
200}
201
Evan Chengc70d1842007-03-20 08:11:30 +0000202// Break so_imm's up into two pieces. This handles immediates with up to 16
203// bits set in them. This uses so_imm2part to match and so_imm2part_[12] to
204// get the first/second pieces.
205def so_imm2part : Operand<i32>,
206 PatLeaf<(imm),
207 [{ return ARM_AM::isSOImmTwoPartVal((unsigned)N->getValue()); }]> {
208 let PrintMethod = "printSOImm2PartOperand";
209}
210
211def so_imm2part_1 : SDNodeXForm<imm, [{
212 unsigned V = ARM_AM::getSOImmTwoPartFirst((unsigned)N->getValue());
213 return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(V), MVT::i32);
214}]>;
215
216def so_imm2part_2 : SDNodeXForm<imm, [{
217 unsigned V = ARM_AM::getSOImmTwoPartSecond((unsigned)N->getValue());
218 return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(V), MVT::i32);
219}]>;
220
Evan Chenga8e29892007-01-19 07:51:42 +0000221
222// Define ARM specific addressing modes.
223
224// addrmode2 := reg +/- reg shop imm
225// addrmode2 := reg +/- imm12
226//
227def addrmode2 : Operand<i32>,
228 ComplexPattern<i32, 3, "SelectAddrMode2", []> {
229 let PrintMethod = "printAddrMode2Operand";
230 let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm);
231}
232
233def am2offset : Operand<i32>,
234 ComplexPattern<i32, 2, "SelectAddrMode2Offset", []> {
235 let PrintMethod = "printAddrMode2OffsetOperand";
236 let MIOperandInfo = (ops GPR, i32imm);
237}
238
239// addrmode3 := reg +/- reg
240// addrmode3 := reg +/- imm8
241//
242def addrmode3 : Operand<i32>,
243 ComplexPattern<i32, 3, "SelectAddrMode3", []> {
244 let PrintMethod = "printAddrMode3Operand";
245 let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm);
246}
247
248def am3offset : Operand<i32>,
249 ComplexPattern<i32, 2, "SelectAddrMode3Offset", []> {
250 let PrintMethod = "printAddrMode3OffsetOperand";
251 let MIOperandInfo = (ops GPR, i32imm);
252}
253
254// addrmode4 := reg, <mode|W>
255//
256def addrmode4 : Operand<i32>,
257 ComplexPattern<i32, 2, "", []> {
258 let PrintMethod = "printAddrMode4Operand";
259 let MIOperandInfo = (ops GPR, i32imm);
260}
261
262// addrmode5 := reg +/- imm8*4
263//
264def addrmode5 : Operand<i32>,
265 ComplexPattern<i32, 2, "SelectAddrMode5", []> {
266 let PrintMethod = "printAddrMode5Operand";
267 let MIOperandInfo = (ops GPR, i32imm);
268}
269
270// addrmodepc := pc + reg
271//
272def addrmodepc : Operand<i32>,
273 ComplexPattern<i32, 2, "SelectAddrModePC", []> {
274 let PrintMethod = "printAddrModePCOperand";
275 let MIOperandInfo = (ops GPR, i32imm);
276}
277
278//===----------------------------------------------------------------------===//
279// ARM Instruction flags. These need to match ARMInstrInfo.h.
280//
281
282// Addressing mode.
283class AddrMode<bits<4> val> {
284 bits<4> Value = val;
285}
286def AddrModeNone : AddrMode<0>;
287def AddrMode1 : AddrMode<1>;
288def AddrMode2 : AddrMode<2>;
289def AddrMode3 : AddrMode<3>;
290def AddrMode4 : AddrMode<4>;
291def AddrMode5 : AddrMode<5>;
292def AddrModeT1 : AddrMode<6>;
293def AddrModeT2 : AddrMode<7>;
294def AddrModeT4 : AddrMode<8>;
295def AddrModeTs : AddrMode<9>;
296
297// Instruction size.
298class SizeFlagVal<bits<3> val> {
299 bits<3> Value = val;
300}
301def SizeInvalid : SizeFlagVal<0>; // Unset.
302def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
303def Size8Bytes : SizeFlagVal<2>;
304def Size4Bytes : SizeFlagVal<3>;
305def Size2Bytes : SizeFlagVal<4>;
306
307// Load / store index mode.
308class IndexMode<bits<2> val> {
309 bits<2> Value = val;
310}
311def IndexModeNone : IndexMode<0>;
312def IndexModePre : IndexMode<1>;
313def IndexModePost : IndexMode<2>;
314
315//===----------------------------------------------------------------------===//
316// ARM Instruction templates.
317//
318
319// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
320class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
321 list<Predicate> Predicates = [IsARM];
322}
Evan Cheng34b12d22007-01-19 20:27:35 +0000323class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
324 list<Predicate> Predicates = [IsARM, HasV5TE];
325}
Evan Chenga8e29892007-01-19 07:51:42 +0000326class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
327 list<Predicate> Predicates = [IsARM, HasV6];
328}
329
Evan Chenga8e29892007-01-19 07:51:42 +0000330class InstARM<bits<4> opcod, AddrMode am, SizeFlagVal sz, IndexMode im,
331 dag ops, string asmstr, string cstr>
332 : Instruction {
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000333 let Namespace = "ARM";
334
Evan Chenga8e29892007-01-19 07:51:42 +0000335 bits<4> Opcode = opcod;
336 AddrMode AM = am;
337 bits<4> AddrModeBits = AM.Value;
338
339 SizeFlagVal SZ = sz;
340 bits<3> SizeFlag = SZ.Value;
341
342 IndexMode IM = im;
343 bits<2> IndexModeBits = IM.Value;
344
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000345 dag OperandList = ops;
346 let AsmString = asmstr;
Evan Chenga8e29892007-01-19 07:51:42 +0000347 let Constraints = cstr;
348}
349
350class PseudoInst<dag ops, string asm, list<dag> pattern>
351 : InstARM<0, AddrModeNone, SizeSpecial, IndexModeNone, ops, asm, ""> {
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000352 let Pattern = pattern;
353}
354
Evan Chenga8e29892007-01-19 07:51:42 +0000355class I<dag ops, AddrMode am, SizeFlagVal sz, IndexMode im,
356 string asm, string cstr, list<dag> pattern>
357 // FIXME: Set all opcodes to 0 for now.
358 : InstARM<0, am, sz, im, ops, asm, cstr> {
359 let Pattern = pattern;
360 list<Predicate> Predicates = [IsARM];
361}
Rafael Espindola15a6c3e2006-10-16 17:57:20 +0000362
Evan Chenga8e29892007-01-19 07:51:42 +0000363class AI<dag ops, string asm, list<dag> pattern>
364 : I<ops, AddrModeNone, Size4Bytes, IndexModeNone, asm, "", pattern>;
365class AI1<dag ops, string asm, list<dag> pattern>
366 : I<ops, AddrMode1, Size4Bytes, IndexModeNone, asm, "", pattern>;
367class AI2<dag ops, string asm, list<dag> pattern>
368 : I<ops, AddrMode2, Size4Bytes, IndexModeNone, asm, "", pattern>;
369class AI3<dag ops, string asm, list<dag> pattern>
370 : I<ops, AddrMode3, Size4Bytes, IndexModeNone, asm, "", pattern>;
371class AI4<dag ops, string asm, list<dag> pattern>
372 : I<ops, AddrMode4, Size4Bytes, IndexModeNone, asm, "", pattern>;
Evan Chengc70d1842007-03-20 08:11:30 +0000373class AI1x2<dag ops, string asm, list<dag> pattern>
374 : I<ops, AddrMode1, Size8Bytes, IndexModeNone, asm, "", pattern>;
Rafael Espindolaa6f149d2006-10-16 18:32:36 +0000375
Evan Chenga8e29892007-01-19 07:51:42 +0000376// Pre-indexed ops
377class AI2pr<dag ops, string asm, string cstr, list<dag> pattern>
378 : I<ops, AddrMode2, Size4Bytes, IndexModePre, asm, cstr, pattern>;
379class AI3pr<dag ops, string asm, string cstr, list<dag> pattern>
380 : I<ops, AddrMode3, Size4Bytes, IndexModePre, asm, cstr, pattern>;
Rafael Espindola27e469e2006-10-16 18:39:22 +0000381
Evan Chenga8e29892007-01-19 07:51:42 +0000382// Post-indexed ops
383class AI2po<dag ops, string asm, string cstr, list<dag> pattern>
384 : I<ops, AddrMode2, Size4Bytes, IndexModePost, asm, cstr, pattern>;
385class AI3po<dag ops, string asm, string cstr, list<dag> pattern>
386 : I<ops, AddrMode3, Size4Bytes, IndexModePost, asm, cstr, pattern>;
Rafael Espindola04d88ff2006-10-17 20:45:22 +0000387
Evan Chenga8e29892007-01-19 07:51:42 +0000388// BR_JT instructions
389class JTI<dag ops, string asm, list<dag> pattern>
390 : I<ops, AddrModeNone, SizeSpecial, IndexModeNone, asm, "", pattern>;
391class JTI1<dag ops, string asm, list<dag> pattern>
392 : I<ops, AddrMode1, SizeSpecial, IndexModeNone, asm, "", pattern>;
393class JTI2<dag ops, string asm, list<dag> pattern>
394 : I<ops, AddrMode2, SizeSpecial, IndexModeNone, asm, "", pattern>;
Rafael Espindola04d88ff2006-10-17 20:45:22 +0000395
Evan Chenga8e29892007-01-19 07:51:42 +0000396
397class BinOpFrag<dag res> : PatFrag<(ops node:$LHS, node:$RHS), res>;
398class UnOpFrag <dag res> : PatFrag<(ops node:$Src), res>;
399
400
401/// AI1_bin_irs - Defines a set of (op r, {so_imm|r|so_reg}) patterns for a
402/// binop that produces a value.
403multiclass AI1_bin_irs<string opc, PatFrag opnode> {
404 def ri : AI1<(ops GPR:$dst, GPR:$a, so_imm:$b),
405 !strconcat(opc, " $dst, $a, $b"),
406 [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
407 def rr : AI1<(ops GPR:$dst, GPR:$a, GPR:$b),
408 !strconcat(opc, " $dst, $a, $b"),
409 [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
410 def rs : AI1<(ops GPR:$dst, GPR:$a, so_reg:$b),
411 !strconcat(opc, " $dst, $a, $b"),
412 [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
413}
414
415/// AI1_bin0_irs - Defines a set of (op r, {so_imm|r|so_reg}) patterns.
416/// Similar to AI1_bin_irs except the instruction does not produce a result.
417multiclass AI1_bin0_irs<string opc, PatFrag opnode> {
418 def ri : AI1<(ops GPR:$a, so_imm:$b),
419 !strconcat(opc, " $a, $b"),
420 [(opnode GPR:$a, so_imm:$b)]>;
421 def rr : AI1<(ops GPR:$a, GPR:$b),
422 !strconcat(opc, " $a, $b"),
423 [(opnode GPR:$a, GPR:$b)]>;
424 def rs : AI1<(ops GPR:$a, so_reg:$b),
425 !strconcat(opc, " $a, $b"),
426 [(opnode GPR:$a, so_reg:$b)]>;
427}
428
429/// AI1_bin_is - Defines a set of (op r, {so_imm|so_reg}) patterns for a binop.
430multiclass AI1_bin_is<string opc, PatFrag opnode> {
431 def ri : AI1<(ops GPR:$dst, GPR:$a, so_imm:$b),
432 !strconcat(opc, " $dst, $a, $b"),
433 [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
434 def rs : AI1<(ops GPR:$dst, GPR:$a, so_reg:$b),
435 !strconcat(opc, " $dst, $a, $b"),
436 [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
437}
438
439/// AI1_unary_irs - Defines a set of (op {so_imm|r|so_reg}) patterns for unary
440/// ops.
441multiclass AI1_unary_irs<string opc, PatFrag opnode> {
442 def i : AI1<(ops GPR:$dst, so_imm:$a),
443 !strconcat(opc, " $dst, $a"),
444 [(set GPR:$dst, (opnode so_imm:$a))]>;
445 def r : AI1<(ops GPR:$dst, GPR:$a),
446 !strconcat(opc, " $dst, $a"),
447 [(set GPR:$dst, (opnode GPR:$a))]>;
448 def s : AI1<(ops GPR:$dst, so_reg:$a),
449 !strconcat(opc, " $dst, $a"),
450 [(set GPR:$dst, (opnode so_reg:$a))]>;
451}
452
453/// AI_unary_rrot - A unary operation with two forms: one whose operand is a
454/// register and one whose operand is a register rotated by 8/16/24.
455multiclass AI_unary_rrot<string opc, PatFrag opnode> {
456 def r : AI<(ops GPR:$dst, GPR:$Src),
457 !strconcat(opc, " $dst, $Src"),
458 [(set GPR:$dst, (opnode GPR:$Src))]>, Requires<[IsARM, HasV6]>;
459 def r_rot : AI<(ops GPR:$dst, GPR:$Src, i32imm:$rot),
460 !strconcat(opc, " $dst, $Src, ror $rot"),
461 [(set GPR:$dst, (opnode (rotr GPR:$Src, rot_imm:$rot)))]>,
462 Requires<[IsARM, HasV6]>;
463}
464
465/// AI_bin_rrot - A binary operation with two forms: one whose operand is a
466/// register and one whose operand is a register rotated by 8/16/24.
467multiclass AI_bin_rrot<string opc, PatFrag opnode> {
468 def rr : AI<(ops GPR:$dst, GPR:$LHS, GPR:$RHS),
469 !strconcat(opc, " $dst, $LHS, $RHS"),
470 [(set GPR:$dst, (opnode GPR:$LHS, GPR:$RHS))]>,
471 Requires<[IsARM, HasV6]>;
472 def rr_rot : AI<(ops GPR:$dst, GPR:$LHS, GPR:$RHS, i32imm:$rot),
473 !strconcat(opc, " $dst, $LHS, $RHS, ror $rot"),
474 [(set GPR:$dst, (opnode GPR:$LHS,
475 (rotr GPR:$RHS, rot_imm:$rot)))]>,
476 Requires<[IsARM, HasV6]>;
477}
478
Rafael Espindola90057aa2006-10-16 18:18:14 +0000479
Rafael Espindola15a6c3e2006-10-16 17:57:20 +0000480//===----------------------------------------------------------------------===//
481// Instructions
482//===----------------------------------------------------------------------===//
483
Evan Chenga8e29892007-01-19 07:51:42 +0000484//===----------------------------------------------------------------------===//
485// Miscellaneous Instructions.
486//
487def IMPLICIT_DEF_GPR :
488PseudoInst<(ops GPR:$rD),
489 "@ IMPLICIT_DEF_GPR $rD",
490 [(set GPR:$rD, (undef))]>;
Rafael Espindola687bc492006-08-24 13:45:55 +0000491
Rafael Espindola6f602de2006-08-24 16:13:15 +0000492
Evan Chenga8e29892007-01-19 07:51:42 +0000493/// CONSTPOOL_ENTRY - This instruction represents a floating constant pool in
494/// the function. The first operand is the ID# for this instruction, the second
495/// is the index into the MachineConstantPool that this is, the third is the
496/// size in bytes of this constant pool entry.
497def CONSTPOOL_ENTRY :
498PseudoInst<(ops cpinst_operand:$instid, cpinst_operand:$cpidx, i32imm:$size),
499 "${instid:label} ${cpidx:cpentry}", []>;
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000500
Evan Chenga8e29892007-01-19 07:51:42 +0000501def ADJCALLSTACKUP :
502PseudoInst<(ops i32imm:$amt),
503 "@ ADJCALLSTACKUP $amt",
504 [(ARMcallseq_end imm:$amt)]>, Imp<[SP],[SP]>;
Rafael Espindolacdda88c2006-08-24 17:19:08 +0000505
Evan Chenga8e29892007-01-19 07:51:42 +0000506def ADJCALLSTACKDOWN :
507PseudoInst<(ops i32imm:$amt),
508 "@ ADJCALLSTACKDOWN $amt",
509 [(ARMcallseq_start imm:$amt)]>, Imp<[SP],[SP]>;
Rafael Espindola3c000bf2006-08-21 22:00:32 +0000510
Evan Chenga8e29892007-01-19 07:51:42 +0000511def DWARF_LOC :
512PseudoInst<(ops i32imm:$line, i32imm:$col, i32imm:$file),
513 ".loc $file, $line, $col",
514 [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>;
Rafael Espindola4b20fbc2006-10-10 12:56:00 +0000515
Evan Chenga8e29892007-01-19 07:51:42 +0000516def PICADD : AI1<(ops GPR:$dst, GPR:$a, pclabel:$cp),
Evan Chengc60e76d2007-01-30 20:37:08 +0000517 "$cp:\n\tadd $dst, pc, $a",
Evan Chenga8e29892007-01-19 07:51:42 +0000518 [(set GPR:$dst, (ARMpic_add GPR:$a, imm:$cp))]>;
519let AddedComplexity = 10 in
520def PICLD : AI2<(ops GPR:$dst, addrmodepc:$addr),
Evan Chengc60e76d2007-01-30 20:37:08 +0000521 "${addr:label}:\n\tldr $dst, $addr",
Evan Chenga8e29892007-01-19 07:51:42 +0000522 [(set GPR:$dst, (load addrmodepc:$addr))]>;
Rafael Espindola84b19be2006-07-16 01:02:57 +0000523
Evan Chenga8e29892007-01-19 07:51:42 +0000524//===----------------------------------------------------------------------===//
525// Control Flow Instructions.
526//
Rafael Espindola9e071f02006-10-02 19:30:56 +0000527
Evan Chenga8e29892007-01-19 07:51:42 +0000528let isReturn = 1, isTerminator = 1 in
529 def BX_RET : AI<(ops), "bx lr", [(ARMretflag)]>;
Rafael Espindola27185192006-09-29 21:20:16 +0000530
Evan Chenga8e29892007-01-19 07:51:42 +0000531// FIXME: remove when we have a way to marking a MI with these properties.
532let isLoad = 1, isReturn = 1, isTerminator = 1 in
533 def LDM_RET : AI4<(ops addrmode4:$addr, reglist:$dst1, variable_ops),
534 "ldm${addr:submode} $addr, $dst1",
535 []>;
Rafael Espindolaa2845842006-10-05 16:48:49 +0000536
Evan Chenga8e29892007-01-19 07:51:42 +0000537let isCall = 1, noResults = 1,
538 Defs = [R0, R1, R2, R3, R12, LR,
539 D0, D1, D2, D3, D4, D5, D6, D7] in {
540 def BL : AI<(ops i32imm:$func, variable_ops),
541 "bl ${func:call}",
542 [(ARMcall tglobaladdr:$func)]>;
543 // ARMv5T and above
544 def BLX : AI<(ops GPR:$dst, variable_ops),
545 "blx $dst",
546 [(ARMcall GPR:$dst)]>, Requires<[IsARM, HasV5T]>;
Lauro Ramos Venancio64c88d72007-03-20 17:57:23 +0000547 let Uses = [LR] in {
548 // ARMv4T
549 def BX : AI<(ops GPR:$dst, variable_ops),
550 "bx $dst",
Evan Chenga8e29892007-01-19 07:51:42 +0000551 [(ARMcall_nolink GPR:$dst)]>;
Lauro Ramos Venancio64c88d72007-03-20 17:57:23 +0000552 }
Rafael Espindola35574632006-07-18 17:00:30 +0000553}
Rafael Espindoladc124a22006-05-18 21:45:49 +0000554
Evan Chenga8e29892007-01-19 07:51:42 +0000555let isBranch = 1, isTerminator = 1, isBarrier = 1 in {
556 def B : AI<(ops brtarget:$dst), "b $dst",
557 [(br bb:$dst)]>;
558
559 def BR_JTr : JTI<(ops GPR:$dst, jtblock_operand:$jt, i32imm:$id),
560 "mov pc, $dst \n$jt",
561 [(ARMbrjt GPR:$dst, tjumptable:$jt, imm:$id)]>;
562 def BR_JTm : JTI2<(ops addrmode2:$dst, jtblock_operand:$jt, i32imm:$id),
563 "ldr pc, $dst \n$jt",
564 [(ARMbrjt (i32 (load addrmode2:$dst)), tjumptable:$jt,
565 imm:$id)]>;
566 def BR_JTadd : JTI1<(ops GPR:$dst, GPR:$idx, jtblock_operand:$jt, i32imm:$id),
567 "add pc, $dst, $idx \n$jt",
568 [(ARMbrjt (add GPR:$dst, GPR:$idx), tjumptable:$jt,
569 imm:$id)]>;
Rafael Espindola1ed3af12006-08-01 18:53:10 +0000570}
Rafael Espindola84b19be2006-07-16 01:02:57 +0000571
Evan Chenga8e29892007-01-19 07:51:42 +0000572let isBranch = 1, isTerminator = 1, noResults = 1, isBarrier = 1 in
573 def Bcc : AI<(ops brtarget:$dst, CCOp:$cc), "b$cc $dst",
574 [(ARMbrcond bb:$dst, imm:$cc)]>;
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000575
Evan Chenga8e29892007-01-19 07:51:42 +0000576//===----------------------------------------------------------------------===//
577// Load / store Instructions.
578//
Rafael Espindola82c678b2006-10-16 17:17:22 +0000579
Evan Chenga8e29892007-01-19 07:51:42 +0000580// Load
581let isLoad = 1 in {
582def LDR : AI2<(ops GPR:$dst, addrmode2:$addr),
583 "ldr $dst, $addr",
584 [(set GPR:$dst, (load addrmode2:$addr))]>;
Rafael Espindola82c678b2006-10-16 17:17:22 +0000585
Evan Chengfa775d02007-03-19 07:20:03 +0000586// Special LDR for loads from non-pc-relative constpools.
587let isReMaterializable = 1 in
588def LDRcp : AI2<(ops GPR:$dst, addrmode2:$addr),
589 "ldr $dst, $addr", []>;
590
Evan Chenga8e29892007-01-19 07:51:42 +0000591// Loads with zero extension
592def LDRH : AI3<(ops GPR:$dst, addrmode3:$addr),
593 "ldrh $dst, $addr",
594 [(set GPR:$dst, (zextloadi16 addrmode3:$addr))]>;
Rafael Espindola82c678b2006-10-16 17:17:22 +0000595
Evan Chenga8e29892007-01-19 07:51:42 +0000596def LDRB : AI2<(ops GPR:$dst, addrmode2:$addr),
597 "ldrb $dst, $addr",
598 [(set GPR:$dst, (zextloadi8 addrmode2:$addr))]>;
Rafael Espindola82c678b2006-10-16 17:17:22 +0000599
Evan Chenga8e29892007-01-19 07:51:42 +0000600// Loads with sign extension
601def LDRSH : AI3<(ops GPR:$dst, addrmode3:$addr),
602 "ldrsh $dst, $addr",
603 [(set GPR:$dst, (sextloadi16 addrmode3:$addr))]>;
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000604
Evan Chenga8e29892007-01-19 07:51:42 +0000605def LDRSB : AI3<(ops GPR:$dst, addrmode3:$addr),
606 "ldrsb $dst, $addr",
607 [(set GPR:$dst, (sextloadi8 addrmode3:$addr))]>;
Rafael Espindolac391d162006-10-23 20:34:27 +0000608
Evan Chenga8e29892007-01-19 07:51:42 +0000609// Load doubleword
610def LDRD : AI3<(ops GPR:$dst, addrmode3:$addr),
611 "ldrd $dst, $addr",
612 []>, Requires<[IsARM, HasV5T]>;
Rafael Espindolac391d162006-10-23 20:34:27 +0000613
Evan Chenga8e29892007-01-19 07:51:42 +0000614// Indexed loads
615def LDR_PRE : AI2pr<(ops GPR:$dst, GPR:$base_wb, addrmode2:$addr),
616 "ldr $dst, $addr!", "$addr.base = $base_wb", []>;
Rafael Espindoladc124a22006-05-18 21:45:49 +0000617
Evan Chenga8e29892007-01-19 07:51:42 +0000618def LDR_POST : AI2po<(ops GPR:$dst, GPR:$base_wb, GPR:$base, am2offset:$offset),
619 "ldr $dst, [$base], $offset", "$base = $base_wb", []>;
Rafael Espindola450856d2006-12-12 00:37:38 +0000620
Evan Chenga8e29892007-01-19 07:51:42 +0000621def LDRH_PRE : AI3pr<(ops GPR:$dst, GPR:$base_wb, addrmode3:$addr),
622 "ldrh $dst, $addr!", "$addr.base = $base_wb", []>;
Rafael Espindola4e307642006-09-08 16:59:47 +0000623
Evan Chenga8e29892007-01-19 07:51:42 +0000624def LDRH_POST : AI3po<(ops GPR:$dst, GPR:$base_wb, GPR:$base,am3offset:$offset),
625 "ldrh $dst, [$base], $offset", "$base = $base_wb", []>;
Lauro Ramos Venancio301009a2006-12-28 13:11:14 +0000626
Evan Chenga8e29892007-01-19 07:51:42 +0000627def LDRB_PRE : AI2pr<(ops GPR:$dst, GPR:$base_wb, addrmode2:$addr),
628 "ldrb $dst, $addr!", "$addr.base = $base_wb", []>;
Lauro Ramos Venancio301009a2006-12-28 13:11:14 +0000629
Evan Chenga8e29892007-01-19 07:51:42 +0000630def LDRB_POST : AI2po<(ops GPR:$dst, GPR:$base_wb, GPR:$base,am2offset:$offset),
631 "ldrb $dst, [$base], $offset", "$base = $base_wb", []>;
632
633def LDRSH_PRE : AI3pr<(ops GPR:$dst, GPR:$base_wb, addrmode3:$addr),
634 "ldrsh $dst, $addr!", "$addr.base = $base_wb", []>;
635
636def LDRSH_POST: AI3po<(ops GPR:$dst, GPR:$base_wb, GPR:$base,am3offset:$offset),
637 "ldrsh $dst, [$base], $offset", "$base = $base_wb", []>;
638
639def LDRSB_PRE : AI3pr<(ops GPR:$dst, GPR:$base_wb, addrmode3:$addr),
640 "ldrsb $dst, $addr!", "$addr.base = $base_wb", []>;
641
642def LDRSB_POST: AI3po<(ops GPR:$dst, GPR:$base_wb, GPR:$base,am3offset:$offset),
643 "ldrsb $dst, [$base], $offset", "$base = $base_wb", []>;
644} // isLoad
645
646// Store
647let isStore = 1 in {
648def STR : AI2<(ops GPR:$src, addrmode2:$addr),
649 "str $src, $addr",
650 [(store GPR:$src, addrmode2:$addr)]>;
651
652// Stores with truncate
653def STRH : AI3<(ops GPR:$src, addrmode3:$addr),
654 "strh $src, $addr",
655 [(truncstorei16 GPR:$src, addrmode3:$addr)]>;
656
657def STRB : AI2<(ops GPR:$src, addrmode2:$addr),
658 "strb $src, $addr",
659 [(truncstorei8 GPR:$src, addrmode2:$addr)]>;
660
661// Store doubleword
662def STRD : AI3<(ops GPR:$src, addrmode3:$addr),
663 "strd $src, $addr",
664 []>, Requires<[IsARM, HasV5T]>;
665
666// Indexed stores
667def STR_PRE : AI2pr<(ops GPR:$base_wb, GPR:$src, GPR:$base, am2offset:$offset),
668 "str $src, [$base, $offset]!", "$base = $base_wb",
669 [(set GPR:$base_wb,
670 (pre_store GPR:$src, GPR:$base, am2offset:$offset))]>;
671
672def STR_POST : AI2po<(ops GPR:$base_wb, GPR:$src, GPR:$base,am2offset:$offset),
673 "str $src, [$base], $offset", "$base = $base_wb",
674 [(set GPR:$base_wb,
675 (post_store GPR:$src, GPR:$base, am2offset:$offset))]>;
676
677def STRH_PRE : AI3pr<(ops GPR:$base_wb, GPR:$src, GPR:$base,am3offset:$offset),
678 "strh $src, [$base, $offset]!", "$base = $base_wb",
679 [(set GPR:$base_wb,
680 (pre_truncsti16 GPR:$src, GPR:$base,am3offset:$offset))]>;
681
682def STRH_POST: AI3po<(ops GPR:$base_wb, GPR:$src, GPR:$base,am3offset:$offset),
683 "strh $src, [$base], $offset", "$base = $base_wb",
684 [(set GPR:$base_wb, (post_truncsti16 GPR:$src,
685 GPR:$base, am3offset:$offset))]>;
686
687def STRB_PRE : AI2pr<(ops GPR:$base_wb, GPR:$src, GPR:$base,am2offset:$offset),
688 "strb $src, [$base, $offset]!", "$base = $base_wb",
689 [(set GPR:$base_wb, (pre_truncsti8 GPR:$src,
690 GPR:$base, am2offset:$offset))]>;
691
692def STRB_POST: AI2po<(ops GPR:$base_wb, GPR:$src, GPR:$base,am2offset:$offset),
693 "strb $src, [$base], $offset", "$base = $base_wb",
694 [(set GPR:$base_wb, (post_truncsti8 GPR:$src,
695 GPR:$base, am2offset:$offset))]>;
696} // isStore
697
698//===----------------------------------------------------------------------===//
699// Load / store multiple Instructions.
700//
701
702let isLoad = 1 in
703def LDM : AI4<(ops addrmode4:$addr, reglist:$dst1, variable_ops),
704 "ldm${addr:submode} $addr, $dst1",
705 []>;
706
707let isStore = 1 in
708def STM : AI4<(ops addrmode4:$addr, reglist:$src1, variable_ops),
709 "stm${addr:submode} $addr, $src1",
710 []>;
711
712//===----------------------------------------------------------------------===//
713// Move Instructions.
714//
715
Evan Cheng9f6636f2007-03-19 07:48:02 +0000716def MOVr : AI1<(ops GPR:$dst, GPR:$src),
Evan Chenga8e29892007-01-19 07:51:42 +0000717 "mov $dst, $src", []>;
Evan Cheng9f6636f2007-03-19 07:48:02 +0000718def MOVs : AI1<(ops GPR:$dst, so_reg:$src),
Evan Chenga8e29892007-01-19 07:51:42 +0000719 "mov $dst, $src", [(set GPR:$dst, so_reg:$src)]>;
Evan Chenga2515702007-03-19 07:09:02 +0000720
721let isReMaterializable = 1 in
Evan Cheng9f6636f2007-03-19 07:48:02 +0000722def MOVi : AI1<(ops GPR:$dst, so_imm:$src),
Evan Chenga8e29892007-01-19 07:51:42 +0000723 "mov $dst, $src", [(set GPR:$dst, so_imm:$src)]>;
724
725// These aren't really mov instructions, but we have to define them this way
726// due to flag operands.
727
728def MOVsrl_flag : AI1<(ops GPR:$dst, GPR:$src),
729 "movs $dst, $src, lsr #1",
730 [(set GPR:$dst, (ARMsrl_flag GPR:$src))]>;
731def MOVsra_flag : AI1<(ops GPR:$dst, GPR:$src),
732 "movs $dst, $src, asr #1",
733 [(set GPR:$dst, (ARMsra_flag GPR:$src))]>;
Evan Cheng9f6636f2007-03-19 07:48:02 +0000734def MOVrx : AI1<(ops GPR:$dst, GPR:$src),
Evan Chenga8e29892007-01-19 07:51:42 +0000735 "mov $dst, $src, rrx",
736 [(set GPR:$dst, (ARMrrx GPR:$src))]>;
737
738
739//===----------------------------------------------------------------------===//
740// Extend Instructions.
741//
742
743// Sign extenders
744
745defm SXTB : AI_unary_rrot<"sxtb", UnOpFrag<(sext_inreg node:$Src, i8)>>;
746defm SXTH : AI_unary_rrot<"sxth", UnOpFrag<(sext_inreg node:$Src, i16)>>;
747
748defm SXTAB : AI_bin_rrot<"sxtab",
749 BinOpFrag<(add node:$LHS, (sext_inreg node:$RHS, i8))>>;
750defm SXTAH : AI_bin_rrot<"sxtah",
751 BinOpFrag<(add node:$LHS, (sext_inreg node:$RHS,i16))>>;
752
753// TODO: SXT(A){B|H}16
754
755// Zero extenders
756
757let AddedComplexity = 16 in {
758defm UXTB : AI_unary_rrot<"uxtb" , UnOpFrag<(and node:$Src, 0x000000FF)>>;
759defm UXTH : AI_unary_rrot<"uxth" , UnOpFrag<(and node:$Src, 0x0000FFFF)>>;
760defm UXTB16 : AI_unary_rrot<"uxtb16", UnOpFrag<(and node:$Src, 0x00FF00FF)>>;
761
762def : ARMV6Pat<(and (shl GPR:$Src, 8), 0xFF00FF),
763 (UXTB16r_rot GPR:$Src, 24)>;
764def : ARMV6Pat<(and (srl GPR:$Src, 8), 0xFF00FF),
765 (UXTB16r_rot GPR:$Src, 8)>;
766
767defm UXTAB : AI_bin_rrot<"uxtab",
768 BinOpFrag<(add node:$LHS, (and node:$RHS, 0x00FF))>>;
769defm UXTAH : AI_bin_rrot<"uxtah",
770 BinOpFrag<(add node:$LHS, (and node:$RHS, 0xFFFF))>>;
Rafael Espindola3c000bf2006-08-21 22:00:32 +0000771}
772
Evan Chenga8e29892007-01-19 07:51:42 +0000773// This isn't safe in general, the add is two 16-bit units, not a 32-bit add.
774//defm UXTAB16 : xxx<"uxtab16", 0xff00ff>;
Rafael Espindola817e7fd2006-09-11 19:24:19 +0000775
Evan Chenga8e29892007-01-19 07:51:42 +0000776// TODO: UXT(A){B|H}16
777
778//===----------------------------------------------------------------------===//
779// Arithmetic Instructions.
780//
781
782defm ADD : AI1_bin_irs<"add" , BinOpFrag<(add node:$LHS, node:$RHS)>>;
783defm ADDS : AI1_bin_irs<"adds", BinOpFrag<(addc node:$LHS, node:$RHS)>>;
784defm ADC : AI1_bin_irs<"adc" , BinOpFrag<(adde node:$LHS, node:$RHS)>>;
785defm SUB : AI1_bin_irs<"sub" , BinOpFrag<(sub node:$LHS, node:$RHS)>>;
786defm SUBS : AI1_bin_irs<"subs", BinOpFrag<(subc node:$LHS, node:$RHS)>>;
787defm SBC : AI1_bin_irs<"sbc" , BinOpFrag<(sube node:$LHS, node:$RHS)>>;
788
789// These don't define reg/reg forms, because they are handled above.
790defm RSB : AI1_bin_is <"rsb" , BinOpFrag<(sub node:$RHS, node:$LHS)>>;
791defm RSBS : AI1_bin_is <"rsbs", BinOpFrag<(subc node:$RHS, node:$LHS)>>;
792defm RSC : AI1_bin_is <"rsc" , BinOpFrag<(sube node:$RHS, node:$LHS)>>;
793
794// (sub X, imm) gets canonicalized to (add X, -imm). Match this form.
795def : ARMPat<(add GPR:$src, so_imm_neg:$imm),
796 (SUBri GPR:$src, so_imm_neg:$imm)>;
797
798//def : ARMPat<(addc GPR:$src, so_imm_neg:$imm),
799// (SUBSri GPR:$src, so_imm_neg:$imm)>;
800//def : ARMPat<(adde GPR:$src, so_imm_neg:$imm),
801// (SBCri GPR:$src, so_imm_neg:$imm)>;
802
803// Note: These are implemented in C++ code, because they have to generate
804// ADD/SUBrs instructions, which use a complex pattern that a xform function
805// cannot produce.
806// (mul X, 2^n+1) -> (add (X << n), X)
807// (mul X, 2^n-1) -> (rsb X, (X << n))
808
809
810//===----------------------------------------------------------------------===//
811// Bitwise Instructions.
812//
813
814defm AND : AI1_bin_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>>;
815defm ORR : AI1_bin_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>>;
816defm EOR : AI1_bin_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>>;
817defm BIC : AI1_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
818
Evan Chenga2515702007-03-19 07:09:02 +0000819def MVNr : AI<(ops GPR:$dst, GPR:$src),
820 "mvn $dst, $src", [(set GPR:$dst, (not GPR:$src))]>;
821def MVNs : AI<(ops GPR:$dst, so_reg:$src),
822 "mvn $dst, $src", [(set GPR:$dst, (not so_reg:$src))]>;
823let isReMaterializable = 1 in
824def MVNi : AI<(ops GPR:$dst, so_imm:$imm),
825 "mvn $dst, $imm", [(set GPR:$dst, so_imm_not:$imm)]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000826
827def : ARMPat<(and GPR:$src, so_imm_not:$imm),
828 (BICri GPR:$src, so_imm_not:$imm)>;
829
830//===----------------------------------------------------------------------===//
831// Multiply Instructions.
832//
833
834// AI_orr - Defines a (op r, r) pattern.
835class AI_orr<string opc, SDNode opnode>
836 : AI<(ops GPR:$dst, GPR:$a, GPR:$b),
837 !strconcat(opc, " $dst, $a, $b"),
838 [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
839
840// AI_oorr - Defines a (op (op r, r), r) pattern.
841class AI_oorr<string opc, SDNode opnode1, SDNode opnode2>
842 : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$c),
843 !strconcat(opc, " $dst, $a, $b, $c"),
844 [(set GPR:$dst, (opnode1 (opnode2 GPR:$a, GPR:$b), GPR:$c))]>;
845
846def MUL : AI_orr<"mul", mul>;
847def MLA : AI_oorr<"mla", add, mul>;
848
849// Extra precision multiplies with low / high results
850def SMULL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b),
851 "smull $ldst, $hdst, $a, $b",
852 []>;
853
854def UMULL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b),
855 "umull $ldst, $hdst, $a, $b",
856 []>;
857
858// Multiply + accumulate
859def SMLAL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b),
860 "smlal $ldst, $hdst, $a, $b",
861 []>;
862
863def UMLAL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b),
864 "umlal $ldst, $hdst, $a, $b",
865 []>;
866
867def UMAAL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b),
868 "umaal $ldst, $hdst, $a, $b",
869 []>, Requires<[IsARM, HasV6]>;
870
871// Most significant word multiply
872def SMMUL : AI_orr<"smmul", mulhs>, Requires<[IsARM, HasV6]>;
873def SMMLA : AI_oorr<"smmla", add, mulhs>, Requires<[IsARM, HasV6]>;
874
875
876def SMMLS : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$c),
877 "smmls $dst, $a, $b, $c",
878 [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR:$b)))]>,
879 Requires<[IsARM, HasV6]>;
880
881multiclass AI_smul<string opc, PatFrag opnode> {
Evan Cheng34b12d22007-01-19 20:27:35 +0000882 def BB : AI<(ops GPR:$dst, GPR:$a, GPR:$b),
883 !strconcat(opc, "bb $dst, $a, $b"),
884 [(set GPR:$dst, (opnode (sext_inreg GPR:$a, i16),
885 (sext_inreg GPR:$b, i16)))]>,
886 Requires<[IsARM, HasV5TE]>;
887 def BT : AI<(ops GPR:$dst, GPR:$a, GPR:$b),
888 !strconcat(opc, "bt $dst, $a, $b"),
889 [(set GPR:$dst, (opnode (sext_inreg GPR:$a, i16),
890 (sra GPR:$b, 16)))]>,
891 Requires<[IsARM, HasV5TE]>;
892 def TB : AI<(ops GPR:$dst, GPR:$a, GPR:$b),
893 !strconcat(opc, "tb $dst, $a, $b"),
894 [(set GPR:$dst, (opnode (sra GPR:$a, 16),
895 (sext_inreg GPR:$b, i16)))]>,
896 Requires<[IsARM, HasV5TE]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000897 def TT : AI<(ops GPR:$dst, GPR:$a, GPR:$b),
898 !strconcat(opc, "tt $dst, $a, $b"),
899 [(set GPR:$dst, (opnode (sra GPR:$a, 16),
900 (sra GPR:$b, 16)))]>,
901 Requires<[IsARM, HasV5TE]>;
Evan Cheng34b12d22007-01-19 20:27:35 +0000902 def WB : AI<(ops GPR:$dst, GPR:$a, GPR:$b),
903 !strconcat(opc, "wb $dst, $a, $b"),
904 [(set GPR:$dst, (sra (opnode GPR:$a,
905 (sext_inreg GPR:$b, i16)), 16))]>,
906 Requires<[IsARM, HasV5TE]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000907 def WT : AI<(ops GPR:$dst, GPR:$a, GPR:$b),
908 !strconcat(opc, "wt $dst, $a, $b"),
909 [(set GPR:$dst, (sra (opnode GPR:$a,
910 (sra GPR:$b, 16)), 16))]>,
911 Requires<[IsARM, HasV5TE]>;
Rafael Espindolabec2e382006-10-16 16:33:29 +0000912}
913
Evan Chenga8e29892007-01-19 07:51:42 +0000914multiclass AI_smla<string opc, PatFrag opnode> {
Evan Cheng34b12d22007-01-19 20:27:35 +0000915 def BB : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$acc),
916 !strconcat(opc, "bb $dst, $a, $b, $acc"),
917 [(set GPR:$dst, (add GPR:$acc,
918 (opnode (sext_inreg GPR:$a, i16),
919 (sext_inreg GPR:$b, i16))))]>,
920 Requires<[IsARM, HasV5TE]>;
921 def BT : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$acc),
922 !strconcat(opc, "bt $dst, $a, $b, $acc"),
923 [(set GPR:$dst, (add GPR:$acc, (opnode (sext_inreg GPR:$a, i16),
Evan Chenga8e29892007-01-19 07:51:42 +0000924 (sra GPR:$b, 16))))]>,
Evan Cheng34b12d22007-01-19 20:27:35 +0000925 Requires<[IsARM, HasV5TE]>;
926 def TB : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$acc),
927 !strconcat(opc, "tb $dst, $a, $b, $acc"),
928 [(set GPR:$dst, (add GPR:$acc, (opnode (sra GPR:$a, 16),
929 (sext_inreg GPR:$b, i16))))]>,
930 Requires<[IsARM, HasV5TE]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000931 def TT : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$acc),
932 !strconcat(opc, "tt $dst, $a, $b, $acc"),
933 [(set GPR:$dst, (add GPR:$acc, (opnode (sra GPR:$a, 16),
934 (sra GPR:$b, 16))))]>,
935 Requires<[IsARM, HasV5TE]>;
936
Evan Cheng34b12d22007-01-19 20:27:35 +0000937 def WB : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$acc),
938 !strconcat(opc, "wb $dst, $a, $b, $acc"),
939 [(set GPR:$dst, (add GPR:$acc, (sra (opnode GPR:$a,
940 (sext_inreg GPR:$b, i16)), 16)))]>,
941 Requires<[IsARM, HasV5TE]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000942 def WT : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$acc),
943 !strconcat(opc, "wt $dst, $a, $b, $acc"),
944 [(set GPR:$dst, (add GPR:$acc, (sra (opnode GPR:$a,
945 (sra GPR:$b, 16)), 16)))]>,
946 Requires<[IsARM, HasV5TE]>;
Rafael Espindola70673a12006-10-18 16:20:57 +0000947}
Rafael Espindola5c2aa0a2006-09-08 12:47:03 +0000948
Evan Chenga8e29892007-01-19 07:51:42 +0000949defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>;
950defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>;
Rafael Espindola27185192006-09-29 21:20:16 +0000951
Evan Chenga8e29892007-01-19 07:51:42 +0000952// TODO: Halfword multiple accumulate long: SMLAL<x><y>
953// TODO: Dual halfword multiple: SMUAD, SMUSD, SMLAD, SMLSD, SMLALD, SMLSLD
Rafael Espindola42b62f32006-10-13 13:14:59 +0000954
Evan Chenga8e29892007-01-19 07:51:42 +0000955//===----------------------------------------------------------------------===//
956// Misc. Arithmetic Instructions.
957//
Rafael Espindola0d9fe762006-10-10 16:33:47 +0000958
Evan Chenga8e29892007-01-19 07:51:42 +0000959def CLZ : AI<(ops GPR:$dst, GPR:$src),
960 "clz $dst, $src",
961 [(set GPR:$dst, (ctlz GPR:$src))]>, Requires<[IsARM, HasV5T]>;
Rafael Espindola199dd672006-10-17 13:13:23 +0000962
Evan Chenga8e29892007-01-19 07:51:42 +0000963def REV : AI<(ops GPR:$dst, GPR:$src),
964 "rev $dst, $src",
965 [(set GPR:$dst, (bswap GPR:$src))]>, Requires<[IsARM, HasV6]>;
Rafael Espindola199dd672006-10-17 13:13:23 +0000966
Evan Chenga8e29892007-01-19 07:51:42 +0000967def REV16 : AI<(ops GPR:$dst, GPR:$src),
968 "rev16 $dst, $src",
969 [(set GPR:$dst,
970 (or (and (srl GPR:$src, 8), 0xFF),
971 (or (and (shl GPR:$src, 8), 0xFF00),
972 (or (and (srl GPR:$src, 8), 0xFF0000),
973 (and (shl GPR:$src, 8), 0xFF000000)))))]>,
974 Requires<[IsARM, HasV6]>;
Rafael Espindola27185192006-09-29 21:20:16 +0000975
Evan Chenga8e29892007-01-19 07:51:42 +0000976def REVSH : AI<(ops GPR:$dst, GPR:$src),
977 "revsh $dst, $src",
978 [(set GPR:$dst,
979 (sext_inreg
980 (or (srl (and GPR:$src, 0xFFFF), 8),
981 (shl GPR:$src, 8)), i16))]>,
982 Requires<[IsARM, HasV6]>;
Rafael Espindola27185192006-09-29 21:20:16 +0000983
Evan Chenga8e29892007-01-19 07:51:42 +0000984def PKHBT : AI<(ops GPR:$dst, GPR:$src1, GPR:$src2, i32imm:$shamt),
985 "pkhbt $dst, $src1, $src2, LSL $shamt",
986 [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF),
987 (and (shl GPR:$src2, (i32 imm:$shamt)),
988 0xFFFF0000)))]>,
989 Requires<[IsARM, HasV6]>;
Rafael Espindola27185192006-09-29 21:20:16 +0000990
Evan Chenga8e29892007-01-19 07:51:42 +0000991// Alternate cases for PKHBT where identities eliminate some nodes.
992def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (and GPR:$src2, 0xFFFF0000)),
993 (PKHBT GPR:$src1, GPR:$src2, 0)>;
994def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (shl GPR:$src2, imm16_31:$shamt)),
995 (PKHBT GPR:$src1, GPR:$src2, imm16_31:$shamt)>;
Rafael Espindola9e071f02006-10-02 19:30:56 +0000996
Rafael Espindolaa2845842006-10-05 16:48:49 +0000997
Evan Chenga8e29892007-01-19 07:51:42 +0000998def PKHTB : AI<(ops GPR:$dst, GPR:$src1, GPR:$src2, i32imm:$shamt),
999 "pkhtb $dst, $src1, $src2, ASR $shamt",
1000 [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF0000),
1001 (and (sra GPR:$src2, imm16_31:$shamt),
1002 0xFFFF)))]>, Requires<[IsARM, HasV6]>;
Rafael Espindola9e071f02006-10-02 19:30:56 +00001003
Evan Chenga8e29892007-01-19 07:51:42 +00001004// Alternate cases for PKHTB where identities eliminate some nodes. Note that
1005// a shift amount of 0 is *not legal* here, it is PKHBT instead.
1006def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (srl GPR:$src2, 16)),
1007 (PKHTB GPR:$src1, GPR:$src2, 16)>;
1008def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000),
1009 (and (srl GPR:$src2, imm1_15:$shamt), 0xFFFF)),
1010 (PKHTB GPR:$src1, GPR:$src2, imm1_15:$shamt)>;
Rafael Espindolab47e1d02006-10-10 18:55:14 +00001011
Rafael Espindolad9ae7782006-10-07 13:46:42 +00001012
Evan Chenga8e29892007-01-19 07:51:42 +00001013//===----------------------------------------------------------------------===//
1014// Comparison Instructions...
1015//
Rafael Espindolab47e1d02006-10-10 18:55:14 +00001016
Evan Chenga8e29892007-01-19 07:51:42 +00001017defm CMP : AI1_bin0_irs<"cmp", BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>;
1018defm CMN : AI1_bin0_irs<"cmn", BinOpFrag<(ARMcmp node:$LHS,(ineg node:$RHS))>>;
Rafael Espindolae5bbd6d2006-10-07 14:24:52 +00001019
Evan Chenga8e29892007-01-19 07:51:42 +00001020def : ARMPat<(ARMcmp GPR:$src, so_imm_neg:$imm),
1021 (CMNri GPR:$src, so_imm_neg:$imm)>;
Rafael Espindola493a7fc2006-10-10 20:38:57 +00001022
Evan Chenga8e29892007-01-19 07:51:42 +00001023// Note that TST/TEQ don't set all the same flags that CMP does!
1024def TSTrr : AI1<(ops GPR:$a, so_reg:$b), "tst $a, $b", []>;
1025def TSTri : AI1<(ops GPR:$a, so_imm:$b), "tst $a, $b", []>;
1026def TEQrr : AI1<(ops GPR:$a, so_reg:$b), "teq $a, $b", []>;
1027def TEQri : AI1<(ops GPR:$a, so_imm:$b), "teq $a, $b", []>;
Rafael Espindolae5bbd6d2006-10-07 14:24:52 +00001028
Evan Chenga8e29892007-01-19 07:51:42 +00001029// Conditional moves
1030def MOVCCr : AI<(ops GPR:$dst, GPR:$false, GPR:$true, CCOp:$cc),
1031 "mov$cc $dst, $true",
1032 [(set GPR:$dst, (ARMcmov GPR:$false, GPR:$true, imm:$cc))]>,
1033 RegConstraint<"$false = $dst">;
Rafael Espindola493a7fc2006-10-10 20:38:57 +00001034
Evan Chenga8e29892007-01-19 07:51:42 +00001035def MOVCCs : AI<(ops GPR:$dst, GPR:$false, so_reg:$true, CCOp:$cc),
1036 "mov$cc $dst, $true",
1037 [(set GPR:$dst, (ARMcmov GPR:$false, so_reg:$true,imm:$cc))]>,
1038 RegConstraint<"$false = $dst">;
Rafael Espindola2dc0f2b2006-10-09 17:50:29 +00001039
Evan Chenga8e29892007-01-19 07:51:42 +00001040def MOVCCi : AI<(ops GPR:$dst, GPR:$false, so_imm:$true, CCOp:$cc),
1041 "mov$cc $dst, $true",
1042 [(set GPR:$dst, (ARMcmov GPR:$false, so_imm:$true,imm:$cc))]>,
1043 RegConstraint<"$false = $dst">;
Rafael Espindolad9ae7782006-10-07 13:46:42 +00001044
Rafael Espindola4b20fbc2006-10-10 12:56:00 +00001045
Evan Chenga8e29892007-01-19 07:51:42 +00001046// LEApcrel - Load a pc-relative address into a register without offending the
1047// assembler.
1048def LEApcrel : AI1<(ops GPR:$dst, i32imm:$label),
1049 !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(",
1050 "${:private}PCRELL${:uid}+8))\n"),
1051 !strconcat("${:private}PCRELL${:uid}:\n\t",
1052 "add $dst, pc, #PCRELV${:uid}")),
1053 []>;
Rafael Espindola667c3492006-10-10 19:35:01 +00001054
Evan Chenga8e29892007-01-19 07:51:42 +00001055def LEApcrelJT : AI1<(ops GPR:$dst, i32imm:$label, i32imm:$id),
1056 !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(",
1057 "${:private}PCRELL${:uid}+8))\n"),
1058 !strconcat("${:private}PCRELL${:uid}:\n\t",
1059 "add $dst, pc, #PCRELV${:uid}")),
1060 []>;
Rafael Espindolac01c87c2006-10-17 20:33:13 +00001061
Evan Chenga8e29892007-01-19 07:51:42 +00001062//===----------------------------------------------------------------------===//
1063// Non-Instruction Patterns
1064//
Rafael Espindola5aca9272006-10-07 14:03:39 +00001065
Evan Chenga8e29892007-01-19 07:51:42 +00001066// ConstantPool, GlobalAddress, and JumpTable
1067def : ARMPat<(ARMWrapper tglobaladdr :$dst), (LEApcrel tglobaladdr :$dst)>;
1068def : ARMPat<(ARMWrapper tconstpool :$dst), (LEApcrel tconstpool :$dst)>;
1069def : ARMPat<(ARMWrapperJT tjumptable:$dst, imm:$id),
Evan Chengc70d1842007-03-20 08:11:30 +00001070 (LEApcrelJT tjumptable:$dst, imm:$id)>;
Rafael Espindola5aca9272006-10-07 14:03:39 +00001071
Evan Chenga8e29892007-01-19 07:51:42 +00001072// Large immediate handling.
Rafael Espindola0505be02006-10-16 21:10:32 +00001073
Evan Chenga8e29892007-01-19 07:51:42 +00001074// Two piece so_imms.
Evan Chengc70d1842007-03-20 08:11:30 +00001075let isReMaterializable = 1 in
1076def MOVi2pieces : AI1x2<(ops GPR:$dst, so_imm2part:$src),
1077 "mov $dst, $src",
1078 [(set GPR:$dst, so_imm2part:$src)]>;
Rafael Espindolaf621abc2006-10-17 13:36:07 +00001079
Evan Chenga8e29892007-01-19 07:51:42 +00001080def : ARMPat<(or GPR:$LHS, so_imm2part:$RHS),
1081 (ORRri (ORRri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
1082 (so_imm2part_2 imm:$RHS))>;
1083def : ARMPat<(xor GPR:$LHS, so_imm2part:$RHS),
1084 (EORri (EORri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
1085 (so_imm2part_2 imm:$RHS))>;
Rafael Espindolaf621abc2006-10-17 13:36:07 +00001086
Evan Chenga8e29892007-01-19 07:51:42 +00001087// TODO: add,sub,and, 3-instr forms?
Rafael Espindola0505be02006-10-16 21:10:32 +00001088
Rafael Espindola24357862006-10-19 17:05:03 +00001089
Evan Chenga8e29892007-01-19 07:51:42 +00001090// Direct calls
1091def : ARMPat<(ARMcall texternalsym:$func), (BL texternalsym:$func)>;
Rafael Espindola9dca7ad2006-11-01 14:13:27 +00001092
Evan Chenga8e29892007-01-19 07:51:42 +00001093// zextload i1 -> zextload i8
1094def : ARMPat<(zextloadi1 addrmode2:$addr), (LDRB addrmode2:$addr)>;
Lauro Ramos Venancioa8f9f4a2006-12-26 19:30:42 +00001095
Evan Chenga8e29892007-01-19 07:51:42 +00001096// extload -> zextload
1097def : ARMPat<(extloadi1 addrmode2:$addr), (LDRB addrmode2:$addr)>;
1098def : ARMPat<(extloadi8 addrmode2:$addr), (LDRB addrmode2:$addr)>;
1099def : ARMPat<(extloadi16 addrmode3:$addr), (LDRH addrmode3:$addr)>;
Rafael Espindola9dca7ad2006-11-01 14:13:27 +00001100
Evan Chenga8e29892007-01-19 07:51:42 +00001101// truncstore i1 -> truncstore i8
1102def : Pat<(truncstorei1 GPR:$src, addrmode2:$dst),
1103 (STRB GPR:$src, addrmode2:$dst)>;
1104def : Pat<(pre_truncsti1 GPR:$src, GPR:$base, am2offset:$offset),
1105 (STRB_PRE GPR:$src, GPR:$base, am2offset:$offset)>;
1106def : Pat<(post_truncsti1 GPR:$src, GPR:$base, am2offset:$offset),
1107 (STRB_POST GPR:$src, GPR:$base, am2offset:$offset)>;
1108
Evan Cheng34b12d22007-01-19 20:27:35 +00001109// smul* and smla*
1110def : ARMV5TEPat<(mul (sra (shl GPR:$a, 16), 16), (sra (shl GPR:$b, 16), 16)),
1111 (SMULBB GPR:$a, GPR:$b)>;
1112def : ARMV5TEPat<(mul sext_16_node:$a, sext_16_node:$b),
1113 (SMULBB GPR:$a, GPR:$b)>;
1114def : ARMV5TEPat<(mul (sra (shl GPR:$a, 16), 16), (sra GPR:$b, 16)),
1115 (SMULBT GPR:$a, GPR:$b)>;
1116def : ARMV5TEPat<(mul sext_16_node:$a, (sra GPR:$b, 16)),
1117 (SMULBT GPR:$a, GPR:$b)>;
1118def : ARMV5TEPat<(mul (sra GPR:$a, 16), (sra (shl GPR:$b, 16), 16)),
1119 (SMULTB GPR:$a, GPR:$b)>;
1120def : ARMV5TEPat<(mul (sra GPR:$a, 16), sext_16_node:$b),
1121 (SMULTB GPR:$a, GPR:$b)>;
1122def : ARMV5TEPat<(sra (mul GPR:$a, (sra (shl GPR:$b, 16), 16)), 16),
1123 (SMULWB GPR:$a, GPR:$b)>;
1124def : ARMV5TEPat<(sra (mul GPR:$a, sext_16_node:$b), 16),
1125 (SMULWB GPR:$a, GPR:$b)>;
1126
1127def : ARMV5TEPat<(add GPR:$acc,
1128 (mul (sra (shl GPR:$a, 16), 16),
1129 (sra (shl GPR:$b, 16), 16))),
1130 (SMLABB GPR:$a, GPR:$b, GPR:$acc)>;
1131def : ARMV5TEPat<(add GPR:$acc,
1132 (mul sext_16_node:$a, sext_16_node:$b)),
1133 (SMLABB GPR:$a, GPR:$b, GPR:$acc)>;
1134def : ARMV5TEPat<(add GPR:$acc,
1135 (mul (sra (shl GPR:$a, 16), 16), (sra GPR:$b, 16))),
1136 (SMLABT GPR:$a, GPR:$b, GPR:$acc)>;
1137def : ARMV5TEPat<(add GPR:$acc,
1138 (mul sext_16_node:$a, (sra GPR:$b, 16))),
1139 (SMLABT GPR:$a, GPR:$b, GPR:$acc)>;
1140def : ARMV5TEPat<(add GPR:$acc,
1141 (mul (sra GPR:$a, 16), (sra (shl GPR:$b, 16), 16))),
1142 (SMLATB GPR:$a, GPR:$b, GPR:$acc)>;
1143def : ARMV5TEPat<(add GPR:$acc,
1144 (mul (sra GPR:$a, 16), sext_16_node:$b)),
1145 (SMLATB GPR:$a, GPR:$b, GPR:$acc)>;
1146def : ARMV5TEPat<(add GPR:$acc,
1147 (sra (mul GPR:$a, (sra (shl GPR:$b, 16), 16)), 16)),
1148 (SMLAWB GPR:$a, GPR:$b, GPR:$acc)>;
1149def : ARMV5TEPat<(add GPR:$acc,
1150 (sra (mul GPR:$a, sext_16_node:$b), 16)),
1151 (SMLAWB GPR:$a, GPR:$b, GPR:$acc)>;
1152
Evan Chenga8e29892007-01-19 07:51:42 +00001153//===----------------------------------------------------------------------===//
1154// Thumb Support
1155//
1156
1157include "ARMInstrThumb.td"
1158
1159//===----------------------------------------------------------------------===//
1160// Floating Point Support
1161//
1162
1163include "ARMInstrVFP.td"