Encode misc arithmetic instructions.
[oota-llvm.git] / lib / Target / ARM / ARMInstrInfo.td
1 //===- ARMInstrInfo.td - Target Description for ARM Target -*- tablegen -*-===//
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 ARM instructions in TableGen format.
11 //
12 //===----------------------------------------------------------------------===//
13
14 //===----------------------------------------------------------------------===//
15 // ARM specific DAG Nodes.
16 //
17
18 // Type profiles.
19 def SDT_ARMCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
20 def SDT_ARMCallSeqEnd   : SDCallSeqEnd<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>;
21
22 def SDT_ARMSaveCallPC : SDTypeProfile<0, 1, []>;
23
24 def SDT_ARMcall    : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
25
26 def SDT_ARMCMov    : SDTypeProfile<1, 3,
27                                    [SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>,
28                                     SDTCisVT<3, i32>]>;
29
30 def SDT_ARMBrcond  : SDTypeProfile<0, 2,
31                                    [SDTCisVT<0, OtherVT>, SDTCisVT<1, i32>]>;
32
33 def SDT_ARMBrJT    : SDTypeProfile<0, 3,
34                                   [SDTCisPtrTy<0>, SDTCisVT<1, i32>,
35                                    SDTCisVT<2, i32>]>;
36
37 def SDT_ARMCmp     : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>;
38
39 def SDT_ARMPICAdd  : SDTypeProfile<1, 2, [SDTCisSameAs<0, 1>,
40                                           SDTCisPtrTy<1>, SDTCisVT<2, i32>]>;
41
42 def SDT_ARMThreadPointer : SDTypeProfile<1, 0, [SDTCisPtrTy<0>]>;
43
44 // Node definitions.
45 def ARMWrapper       : SDNode<"ARMISD::Wrapper",     SDTIntUnaryOp>;
46 def ARMWrapperJT     : SDNode<"ARMISD::WrapperJT",   SDTIntBinOp>;
47
48 def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeqStart,
49                               [SDNPHasChain, SDNPOutFlag]>;
50 def ARMcallseq_end   : SDNode<"ISD::CALLSEQ_END",   SDT_ARMCallSeqEnd,
51                               [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
52
53 def ARMcall          : SDNode<"ARMISD::CALL", SDT_ARMcall,
54                               [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
55 def ARMcall_pred    : SDNode<"ARMISD::CALL_PRED", SDT_ARMcall,
56                               [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
57 def ARMcall_nolink   : SDNode<"ARMISD::CALL_NOLINK", SDT_ARMcall,
58                               [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
59
60 def ARMretflag       : SDNode<"ARMISD::RET_FLAG", SDTNone,
61                               [SDNPHasChain, SDNPOptInFlag]>;
62
63 def ARMcmov          : SDNode<"ARMISD::CMOV", SDT_ARMCMov,
64                               [SDNPInFlag]>;
65 def ARMcneg          : SDNode<"ARMISD::CNEG", SDT_ARMCMov,
66                               [SDNPInFlag]>;
67
68 def ARMbrcond        : SDNode<"ARMISD::BRCOND", SDT_ARMBrcond,
69                               [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
70
71 def ARMbrjt          : SDNode<"ARMISD::BR_JT", SDT_ARMBrJT,
72                               [SDNPHasChain]>;
73
74 def ARMcmp           : SDNode<"ARMISD::CMP", SDT_ARMCmp,
75                               [SDNPOutFlag]>;
76
77 def ARMcmpNZ         : SDNode<"ARMISD::CMPNZ", SDT_ARMCmp,
78                               [SDNPOutFlag]>;
79
80 def ARMpic_add       : SDNode<"ARMISD::PIC_ADD", SDT_ARMPICAdd>;
81
82 def ARMsrl_flag      : SDNode<"ARMISD::SRL_FLAG", SDTIntUnaryOp, [SDNPOutFlag]>;
83 def ARMsra_flag      : SDNode<"ARMISD::SRA_FLAG", SDTIntUnaryOp, [SDNPOutFlag]>;
84 def ARMrrx           : SDNode<"ARMISD::RRX"     , SDTIntUnaryOp, [SDNPInFlag ]>;
85
86 def ARMthread_pointer: SDNode<"ARMISD::THREAD_POINTER", SDT_ARMThreadPointer>;
87
88 //===----------------------------------------------------------------------===//
89 // ARM Instruction Predicate Definitions.
90 //
91 def HasV5T  : Predicate<"Subtarget->hasV5TOps()">;
92 def HasV5TE : Predicate<"Subtarget->hasV5TEOps()">;
93 def HasV6   : Predicate<"Subtarget->hasV6Ops()">;
94 def IsThumb : Predicate<"Subtarget->isThumb()">;
95 def IsARM   : Predicate<"!Subtarget->isThumb()">;
96
97 //===----------------------------------------------------------------------===//
98 // ARM Flag Definitions.
99
100 class RegConstraint<string C> {
101   string Constraints = C;
102 }
103
104 //===----------------------------------------------------------------------===//
105 //  ARM specific transformation functions and pattern fragments.
106 //
107
108 // so_imm_XFORM - Return a so_imm value packed into the format described for
109 // so_imm def below.
110 def so_imm_XFORM : SDNodeXForm<imm, [{
111   return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(N->getZExtValue()),
112                                    MVT::i32);
113 }]>;
114
115 // so_imm_neg_XFORM - Return a so_imm value packed into the format described for
116 // so_imm_neg def below.
117 def so_imm_neg_XFORM : SDNodeXForm<imm, [{
118   return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(-(int)N->getZExtValue()),
119                                    MVT::i32);
120 }]>;
121
122 // so_imm_not_XFORM - Return a so_imm value packed into the format described for
123 // so_imm_not def below.
124 def so_imm_not_XFORM : SDNodeXForm<imm, [{
125   return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(~(int)N->getZExtValue()),
126                                    MVT::i32);
127 }]>;
128
129 // rot_imm predicate - True if the 32-bit immediate is equal to 8, 16, or 24.
130 def rot_imm : PatLeaf<(i32 imm), [{
131   int32_t v = (int32_t)N->getZExtValue();
132   return v == 8 || v == 16 || v == 24;
133 }]>;
134
135 /// imm1_15 predicate - True if the 32-bit immediate is in the range [1,15].
136 def imm1_15 : PatLeaf<(i32 imm), [{
137   return (int32_t)N->getZExtValue() >= 1 && (int32_t)N->getZExtValue() < 16;
138 }]>;
139
140 /// imm16_31 predicate - True if the 32-bit immediate is in the range [16,31].
141 def imm16_31 : PatLeaf<(i32 imm), [{
142   return (int32_t)N->getZExtValue() >= 16 && (int32_t)N->getZExtValue() < 32;
143 }]>;
144
145 def so_imm_neg : 
146   PatLeaf<(imm), [{
147     return ARM_AM::getSOImmVal(-(int)N->getZExtValue()) != -1;
148   }], so_imm_neg_XFORM>;
149
150 def so_imm_not :
151   PatLeaf<(imm), [{
152     return ARM_AM::getSOImmVal(~(int)N->getZExtValue()) != -1;
153   }], so_imm_not_XFORM>;
154
155 // sext_16_node predicate - True if the SDNode is sign-extended 16 or more bits.
156 def sext_16_node : PatLeaf<(i32 GPR:$a), [{
157   return CurDAG->ComputeNumSignBits(SDValue(N,0)) >= 17;
158 }]>;
159
160 class BinOpFrag<dag res> : PatFrag<(ops node:$LHS, node:$RHS), res>;
161 class UnOpFrag <dag res> : PatFrag<(ops node:$Src), res>;
162
163 //===----------------------------------------------------------------------===//
164 // Operand Definitions.
165 //
166
167 // Branch target.
168 def brtarget : Operand<OtherVT>;
169
170 // A list of registers separated by comma. Used by load/store multiple.
171 def reglist : Operand<i32> {
172   let PrintMethod = "printRegisterList";
173 }
174
175 // An operand for the CONSTPOOL_ENTRY pseudo-instruction.
176 def cpinst_operand : Operand<i32> {
177   let PrintMethod = "printCPInstOperand";
178 }
179
180 def jtblock_operand : Operand<i32> {
181   let PrintMethod = "printJTBlockOperand";
182 }
183
184 // Local PC labels.
185 def pclabel : Operand<i32> {
186   let PrintMethod = "printPCLabel";
187 }
188
189 // shifter_operand operands: so_reg and so_imm.
190 def so_reg : Operand<i32>,    // reg reg imm
191             ComplexPattern<i32, 3, "SelectShifterOperandReg",
192                             [shl,srl,sra,rotr]> {
193   let PrintMethod = "printSORegOperand";
194   let MIOperandInfo = (ops GPR, GPR, i32imm);
195 }
196
197 // so_imm - Match a 32-bit shifter_operand immediate operand, which is an
198 // 8-bit immediate rotated by an arbitrary number of bits.  so_imm values are
199 // represented in the imm field in the same 12-bit form that they are encoded
200 // into so_imm instructions: the 8-bit immediate is the least significant bits
201 // [bits 0-7], the 4-bit shift amount is the next 4 bits [bits 8-11].
202 def so_imm : Operand<i32>,
203              PatLeaf<(imm),
204                      [{ return ARM_AM::getSOImmVal(N->getZExtValue()) != -1; }],
205                      so_imm_XFORM> {
206   let PrintMethod = "printSOImmOperand";
207 }
208
209 // Break so_imm's up into two pieces.  This handles immediates with up to 16
210 // bits set in them.  This uses so_imm2part to match and so_imm2part_[12] to
211 // get the first/second pieces.
212 def so_imm2part : Operand<i32>,
213                   PatLeaf<(imm), [{
214       return ARM_AM::isSOImmTwoPartVal((unsigned)N->getZExtValue());
215     }]> {
216   let PrintMethod = "printSOImm2PartOperand";
217 }
218
219 def so_imm2part_1 : SDNodeXForm<imm, [{
220   unsigned V = ARM_AM::getSOImmTwoPartFirst((unsigned)N->getZExtValue());
221   return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(V), MVT::i32);
222 }]>;
223
224 def so_imm2part_2 : SDNodeXForm<imm, [{
225   unsigned V = ARM_AM::getSOImmTwoPartSecond((unsigned)N->getZExtValue());
226   return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(V), MVT::i32);
227 }]>;
228
229
230 // Define ARM specific addressing modes.
231
232 // addrmode2 := reg +/- reg shop imm
233 // addrmode2 := reg +/- imm12
234 //
235 def addrmode2 : Operand<i32>,
236                 ComplexPattern<i32, 3, "SelectAddrMode2", []> {
237   let PrintMethod = "printAddrMode2Operand";
238   let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm);
239 }
240
241 def am2offset : Operand<i32>,
242                 ComplexPattern<i32, 2, "SelectAddrMode2Offset", []> {
243   let PrintMethod = "printAddrMode2OffsetOperand";
244   let MIOperandInfo = (ops GPR, i32imm);
245 }
246
247 // addrmode3 := reg +/- reg
248 // addrmode3 := reg +/- imm8
249 //
250 def addrmode3 : Operand<i32>,
251                 ComplexPattern<i32, 3, "SelectAddrMode3", []> {
252   let PrintMethod = "printAddrMode3Operand";
253   let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm);
254 }
255
256 def am3offset : Operand<i32>,
257                 ComplexPattern<i32, 2, "SelectAddrMode3Offset", []> {
258   let PrintMethod = "printAddrMode3OffsetOperand";
259   let MIOperandInfo = (ops GPR, i32imm);
260 }
261
262 // addrmode4 := reg, <mode|W>
263 //
264 def addrmode4 : Operand<i32>,
265                 ComplexPattern<i32, 2, "", []> {
266   let PrintMethod = "printAddrMode4Operand";
267   let MIOperandInfo = (ops GPR, i32imm);
268 }
269
270 // addrmode5 := reg +/- imm8*4
271 //
272 def addrmode5 : Operand<i32>,
273                 ComplexPattern<i32, 2, "SelectAddrMode5", []> {
274   let PrintMethod = "printAddrMode5Operand";
275   let MIOperandInfo = (ops GPR, i32imm);
276 }
277
278 // addrmodepc := pc + reg
279 //
280 def addrmodepc : Operand<i32>,
281                  ComplexPattern<i32, 2, "SelectAddrModePC", []> {
282   let PrintMethod = "printAddrModePCOperand";
283   let MIOperandInfo = (ops GPR, i32imm);
284 }
285
286 // ARM Predicate operand. Default to 14 = always (AL). Second part is CC
287 // register whose default is 0 (no register).
288 def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
289                                      (ops (i32 14), (i32 zero_reg))> {
290   let PrintMethod = "printPredicateOperand";
291 }
292
293 // Conditional code result for instructions whose 's' bit is set, e.g. subs.
294 //
295 def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
296   let PrintMethod = "printSBitModifierOperand";
297 }
298
299 //===----------------------------------------------------------------------===//
300 // ARM Instruction flags.  These need to match ARMInstrInfo.h.
301 //
302
303 // Addressing mode.
304 class AddrMode<bits<4> val> {
305   bits<4> Value = val;
306 }
307 def AddrModeNone : AddrMode<0>;
308 def AddrMode1    : AddrMode<1>;
309 def AddrMode2    : AddrMode<2>;
310 def AddrMode3    : AddrMode<3>;
311 def AddrMode4    : AddrMode<4>;
312 def AddrMode5    : AddrMode<5>;
313 def AddrModeT1   : AddrMode<6>;
314 def AddrModeT2   : AddrMode<7>;
315 def AddrModeT4   : AddrMode<8>;
316 def AddrModeTs   : AddrMode<9>;
317
318 // Instruction size.
319 class SizeFlagVal<bits<3> val> {
320   bits<3> Value = val;
321 }
322 def SizeInvalid  : SizeFlagVal<0>;  // Unset.
323 def SizeSpecial  : SizeFlagVal<1>;  // Pseudo or special.
324 def Size8Bytes   : SizeFlagVal<2>;
325 def Size4Bytes   : SizeFlagVal<3>;
326 def Size2Bytes   : SizeFlagVal<4>;
327
328 // Load / store index mode.
329 class IndexMode<bits<2> val> {
330   bits<2> Value = val;
331 }
332 def IndexModeNone : IndexMode<0>;
333 def IndexModePre  : IndexMode<1>;
334 def IndexModePost : IndexMode<2>;
335
336 //===----------------------------------------------------------------------===//
337
338 include "ARMInstrFormats.td"
339
340 //===----------------------------------------------------------------------===//
341 // Multiclass helpers...
342 //
343
344 /// AsI1_bin_irs - Defines a set of (op r, {so_imm|r|so_reg}) patterns for a
345 /// binop that produces a value.
346 multiclass AsI1_bin_irs<bits<4> opcod, string opc, PatFrag opnode> {
347   def ri : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPFrm,
348                opc, " $dst, $a, $b",
349                [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
350   def rr : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
351                opc, " $dst, $a, $b",
352                [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
353   def rs : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm,
354                opc, " $dst, $a, $b",
355                [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
356 }
357
358 /// ASI1_bin_s_irs - Similar to AsI1_bin_irs except it sets the 's' bit so the
359 /// instruction modifies the CSPR register.
360 let Defs = [CPSR] in {
361 multiclass ASI1_bin_s_irs<bits<4> opcod, string opc, PatFrag opnode> {
362   def ri : AI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPFrm,
363                opc, "s $dst, $a, $b",
364                [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
365   def rr : AI1<opcod, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
366                opc, "s $dst, $a, $b",
367                [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
368   def rs : AI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm,
369                opc, "s $dst, $a, $b",
370                [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
371 }
372 }
373
374 /// AI1_cmp_irs - Defines a set of (op r, {so_imm|r|so_reg}) cmp / test
375 /// patterns. Similar to AsI1_bin_irs except the instruction does not produce
376 /// a explicit result, only implicitly set CPSR.
377 let Defs = [CPSR] in {
378 multiclass AI1_cmp_irs<bits<4> opcod, string opc, PatFrag opnode> {
379   def ri : AI1<opcod, (outs), (ins GPR:$a, so_imm:$b), DPFrm,
380                opc, " $a, $b",
381                [(opnode GPR:$a, so_imm:$b)]>;
382   def rr : AI1<opcod, (outs), (ins GPR:$a, GPR:$b), DPFrm,
383                opc, " $a, $b",
384                [(opnode GPR:$a, GPR:$b)]>;
385   def rs : AI1<opcod, (outs), (ins GPR:$a, so_reg:$b), DPSoRegFrm,
386                opc, " $a, $b",
387                [(opnode GPR:$a, so_reg:$b)]>;
388 }
389 }
390
391 /// AI_unary_rrot - A unary operation with two forms: one whose operand is a
392 /// register and one whose operand is a register rotated by 8/16/24.
393 /// FIXME: Remove the 'r' variant. Its rot_imm is zero.
394 multiclass AI_unary_rrot<bits<8> opcod, string opc, PatFrag opnode> {
395   def r     : AExtI<opcod, (outs GPR:$dst), (ins GPR:$Src),
396                  opc, " $dst, $Src",
397                  [(set GPR:$dst, (opnode GPR:$Src))]>,
398               Requires<[IsARM, HasV6]> {
399                 let Inst{19-16} = 0b1111;
400               }
401   def r_rot : AExtI<opcod, (outs GPR:$dst), (ins GPR:$Src, i32imm:$rot),
402                  opc, " $dst, $Src, ror $rot",
403                  [(set GPR:$dst, (opnode (rotr GPR:$Src, rot_imm:$rot)))]>,
404               Requires<[IsARM, HasV6]> {
405                 let Inst{19-16} = 0b1111;
406               }
407 }
408
409 /// AI_bin_rrot - A binary operation with two forms: one whose operand is a
410 /// register and one whose operand is a register rotated by 8/16/24.
411 multiclass AI_bin_rrot<bits<8> opcod, string opc, PatFrag opnode> {
412   def rr     : AExtI<opcod, (outs GPR:$dst), (ins GPR:$LHS, GPR:$RHS),
413                   opc, " $dst, $LHS, $RHS",
414                   [(set GPR:$dst, (opnode GPR:$LHS, GPR:$RHS))]>,
415                   Requires<[IsARM, HasV6]>;
416   def rr_rot : AExtI<opcod, (outs GPR:$dst), (ins GPR:$LHS, GPR:$RHS, i32imm:$rot),
417                   opc, " $dst, $LHS, $RHS, ror $rot",
418                   [(set GPR:$dst, (opnode GPR:$LHS,
419                                           (rotr GPR:$RHS, rot_imm:$rot)))]>,
420                   Requires<[IsARM, HasV6]>;
421 }
422
423 /// AsXI1_bin_c_irs - Same as AsI1_bin_irs but without the predicate operand and
424 /// setting carry bit. But it can optionally set CPSR.
425 let Uses = [CPSR] in {
426 multiclass AsXI1_bin_c_irs<bits<4> opcod, string opc, PatFrag opnode> {
427   def ri : AXI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_imm:$b, cc_out:$s),
428                 DPFrm, !strconcat(opc, "${s} $dst, $a, $b"),
429                [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
430   def rr : AXI1<opcod, (outs GPR:$dst), (ins GPR:$a, GPR:$b, cc_out:$s),
431                 DPFrm, !strconcat(opc, "${s} $dst, $a, $b"),
432                [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
433   def rs : AXI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_reg:$b, cc_out:$s),
434                 DPSoRegFrm, !strconcat(opc, "${s} $dst, $a, $b"),
435                [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
436 }
437 }
438
439 //===----------------------------------------------------------------------===//
440 // Instructions
441 //===----------------------------------------------------------------------===//
442
443 //===----------------------------------------------------------------------===//
444 //  Miscellaneous Instructions.
445 //
446
447 /// CONSTPOOL_ENTRY - This instruction represents a floating constant pool in
448 /// the function.  The first operand is the ID# for this instruction, the second
449 /// is the index into the MachineConstantPool that this is, the third is the
450 /// size in bytes of this constant pool entry.
451 let isNotDuplicable = 1 in
452 def CONSTPOOL_ENTRY :
453 PseudoInst<(outs), (ins cpinst_operand:$instid, cpinst_operand:$cpidx,
454                     i32imm:$size),
455            "${instid:label} ${cpidx:cpentry}", []>;
456
457 let Defs = [SP], Uses = [SP] in {
458 def ADJCALLSTACKUP :
459 PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2, pred:$p),
460            "@ ADJCALLSTACKUP $amt1",
461            [(ARMcallseq_end timm:$amt1, timm:$amt2)]>;
462
463 def ADJCALLSTACKDOWN : 
464 PseudoInst<(outs), (ins i32imm:$amt, pred:$p),
465            "@ ADJCALLSTACKDOWN $amt",
466            [(ARMcallseq_start timm:$amt)]>;
467 }
468
469 def DWARF_LOC :
470 PseudoInst<(outs), (ins i32imm:$line, i32imm:$col, i32imm:$file),
471            ".loc $file, $line, $col",
472            [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>;
473
474
475 // Address computation and loads and stores in PIC mode.
476 let isNotDuplicable = 1 in {
477 def PICADD : AXI1<0b0100, (outs GPR:$dst), (ins GPR:$a, pclabel:$cp, pred:$p),
478                   Pseudo, "$cp:\n\tadd$p $dst, pc, $a",
479                    [(set GPR:$dst, (ARMpic_add GPR:$a, imm:$cp))]>;
480
481 let AddedComplexity = 10 in {
482 let isSimpleLoad = 1 in
483 def PICLDR  : AXI2ldw<(outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
484                   Pseudo, "${addr:label}:\n\tldr$p $dst, $addr",
485                   [(set GPR:$dst, (load addrmodepc:$addr))]>;
486
487 def PICLDRH : AXI3ldh<(outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
488                   Pseudo, "${addr:label}:\n\tldr${p}h $dst, $addr",
489                   [(set GPR:$dst, (zextloadi16 addrmodepc:$addr))]>;
490
491 def PICLDRB : AXI2ldb<(outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
492                   Pseudo, "${addr:label}:\n\tldr${p}b $dst, $addr",
493                   [(set GPR:$dst, (zextloadi8 addrmodepc:$addr))]>;
494
495 def PICLDRSH : AXI3ldsh<(outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
496                   Pseudo, "${addr:label}:\n\tldr${p}sh $dst, $addr",
497                   [(set GPR:$dst, (sextloadi16 addrmodepc:$addr))]>;
498
499 def PICLDRSB : AXI3ldsb<(outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
500                   Pseudo, "${addr:label}:\n\tldr${p}sb $dst, $addr",
501                   [(set GPR:$dst, (sextloadi8 addrmodepc:$addr))]>;
502 }
503 let AddedComplexity = 10 in {
504 def PICSTR  : AXI2stw<(outs), (ins GPR:$src, addrmodepc:$addr, pred:$p),
505                Pseudo, "${addr:label}:\n\tstr$p $src, $addr",
506                [(store GPR:$src, addrmodepc:$addr)]>;
507
508 def PICSTRH : AXI3sth<(outs), (ins GPR:$src, addrmodepc:$addr, pred:$p),
509                Pseudo, "${addr:label}:\n\tstr${p}h $src, $addr",
510                [(truncstorei16 GPR:$src, addrmodepc:$addr)]>;
511
512 def PICSTRB : AXI2stb<(outs), (ins GPR:$src, addrmodepc:$addr, pred:$p),
513                Pseudo, "${addr:label}:\n\tstr${p}b $src, $addr",
514                [(truncstorei8 GPR:$src, addrmodepc:$addr)]>;
515 }
516 } // isNotDuplicable = 1
517
518 //===----------------------------------------------------------------------===//
519 //  Control Flow Instructions.
520 //
521
522 let isReturn = 1, isTerminator = 1 in
523   def BX_RET : AI<(outs), (ins), BrMiscFrm, "bx", " lr", [(ARMretflag)]> {
524   let Inst{7-4}   = 0b0001;
525   let Inst{19-8}  = 0b111111111111;
526   let Inst{27-20} = 0b00010010;
527 }
528
529 // FIXME: remove when we have a way to marking a MI with these properties.
530 // FIXME: $dst1 should be a def. But the extra ops must be in the end of the
531 // operand list.
532 // FIXME: Should pc be an implicit operand like PICADD, etc?
533 let isReturn = 1, isTerminator = 1 in
534   def LDM_RET : AXI4ld<(outs),
535                     (ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops),
536                     LdMulFrm, "ldm${p}${addr:submode} $addr, $dst1",
537                     []>;
538
539 let isCall = 1,
540   Defs = [R0, R1, R2, R3, R12, LR,
541           D0, D1, D2, D3, D4, D5, D6, D7, CPSR] in {
542   def BL  : ABXI<0b1011, (outs), (ins i32imm:$func, variable_ops),
543                 "bl ${func:call}",
544                 [(ARMcall tglobaladdr:$func)]>;
545
546   def BL_pred : ABI<0b1011, (outs), (ins i32imm:$func, variable_ops),
547                    "bl", " ${func:call}",
548                    [(ARMcall_pred tglobaladdr:$func)]>;
549
550   // ARMv5T and above
551   def BLX : AXI<(outs), (ins GPR:$func, variable_ops), BrMiscFrm,
552                 "blx $func",
553                 [(ARMcall GPR:$func)]>, Requires<[IsARM, HasV5T]> {
554     let Inst{7-4}   = 0b0011;
555     let Inst{19-8}  = 0b111111111111;
556     let Inst{27-20} = 0b00010010;
557   }
558
559   let Uses = [LR] in {
560     // ARMv4T
561     def BX : ABXIx2<(outs), (ins GPR:$func, variable_ops),
562                      "mov lr, pc\n\tbx $func",
563                     [(ARMcall_nolink GPR:$func)]>;
564   }
565 }
566
567 let isBranch = 1, isTerminator = 1 in {
568   // B is "predicable" since it can be xformed into a Bcc.
569   let isBarrier = 1 in {
570     let isPredicable = 1 in
571     def B : ABXI<0b1010, (outs), (ins brtarget:$target), "b $target",
572                 [(br bb:$target)]>;
573
574   let isNotDuplicable = 1, isIndirectBranch = 1 in {
575   def BR_JTr : JTI<0b1101, (outs),
576                            (ins GPR:$target, jtblock_operand:$jt, i32imm:$id),
577                     "mov pc, $target \n$jt",
578                     [(ARMbrjt GPR:$target, tjumptable:$jt, imm:$id)]>;
579   def BR_JTm : JTI2<0, (outs),
580                        (ins addrmode2:$target, jtblock_operand:$jt, i32imm:$id),
581                      "ldr pc, $target \n$jt",
582                      [(ARMbrjt (i32 (load addrmode2:$target)), tjumptable:$jt,
583                        imm:$id)]>;
584   def BR_JTadd : JTI1<0b0100, (outs),
585                               (ins GPR:$target, GPR:$idx, jtblock_operand:$jt,
586                       i32imm:$id),
587                       "add pc, $target, $idx \n$jt",
588                       [(ARMbrjt (add GPR:$target, GPR:$idx), tjumptable:$jt,
589                         imm:$id)]>;
590   }
591   }
592
593   // FIXME: should be able to write a pattern for ARMBrcond, but can't use
594   // a two-value operand where a dag node expects two operands. :( 
595   def Bcc : ABI<0b1010, (outs), (ins brtarget:$target),
596                "b", " $target",
597                [/*(ARMbrcond bb:$target, imm:$cc, CCR:$ccr)*/]>;
598 }
599
600 //===----------------------------------------------------------------------===//
601 //  Load / store Instructions.
602 //
603
604 // Load
605 let isSimpleLoad = 1 in 
606 def LDR  : AI2ldw<(outs GPR:$dst), (ins addrmode2:$addr), LdFrm,
607                "ldr", " $dst, $addr",
608                [(set GPR:$dst, (load addrmode2:$addr))]>;
609
610 // Special LDR for loads from non-pc-relative constpools.
611 let isSimpleLoad = 1, mayLoad = 1, isReMaterializable = 1 in
612 def LDRcp : AI2ldw<(outs GPR:$dst), (ins addrmode2:$addr), LdFrm,
613                  "ldr", " $dst, $addr", []>;
614
615 // Loads with zero extension
616 def LDRH  : AI3ldh<(outs GPR:$dst), (ins addrmode3:$addr), LdMiscFrm,
617                  "ldr", "h $dst, $addr",
618                 [(set GPR:$dst, (zextloadi16 addrmode3:$addr))]>;
619
620 def LDRB  : AI2ldb<(outs GPR:$dst), (ins addrmode2:$addr), LdFrm,
621                  "ldr", "b $dst, $addr",
622                 [(set GPR:$dst, (zextloadi8 addrmode2:$addr))]>;
623
624 // Loads with sign extension
625 def LDRSH : AI3ldsh<(outs GPR:$dst), (ins addrmode3:$addr), LdMiscFrm,
626                  "ldr", "sh $dst, $addr",
627                 [(set GPR:$dst, (sextloadi16 addrmode3:$addr))]>;
628
629 def LDRSB : AI3ldsb<(outs GPR:$dst), (ins addrmode3:$addr), LdMiscFrm,
630                  "ldr", "sb $dst, $addr",
631                 [(set GPR:$dst, (sextloadi8 addrmode3:$addr))]>;
632
633 let mayLoad = 1 in {
634 // Load doubleword
635 def LDRD  : AI3ldd<(outs GPR:$dst), (ins addrmode3:$addr), LdMiscFrm,
636                  "ldr", "d $dst, $addr",
637                 []>, Requires<[IsARM, HasV5T]>;
638
639 // Indexed loads
640 def LDR_PRE  : AI2ldwpr<(outs GPR:$dst, GPR:$base_wb),
641                      (ins addrmode2:$addr), LdFrm,
642                      "ldr", " $dst, $addr!", "$addr.base = $base_wb", []>;
643
644 def LDR_POST : AI2ldwpo<(outs GPR:$dst, GPR:$base_wb),
645                      (ins GPR:$base, am2offset:$offset), LdFrm,
646                      "ldr", " $dst, [$base], $offset", "$base = $base_wb", []>;
647
648 def LDRH_PRE  : AI3ldhpr<(outs GPR:$dst, GPR:$base_wb),
649                      (ins addrmode3:$addr), LdMiscFrm,
650                      "ldr", "h $dst, $addr!", "$addr.base = $base_wb", []>;
651
652 def LDRH_POST : AI3ldhpo<(outs GPR:$dst, GPR:$base_wb),
653                      (ins GPR:$base,am3offset:$offset), LdMiscFrm,
654                      "ldr", "h $dst, [$base], $offset", "$base = $base_wb", []>;
655
656 def LDRB_PRE  : AI2ldbpr<(outs GPR:$dst, GPR:$base_wb),
657                      (ins addrmode2:$addr), LdFrm,
658                      "ldr", "b $dst, $addr!", "$addr.base = $base_wb", []>;
659
660 def LDRB_POST : AI2ldbpo<(outs GPR:$dst, GPR:$base_wb),
661                      (ins GPR:$base,am2offset:$offset), LdFrm,
662                      "ldr", "b $dst, [$base], $offset", "$base = $base_wb", []>;
663
664 def LDRSH_PRE : AI3ldshpr<(outs GPR:$dst, GPR:$base_wb),
665                       (ins addrmode3:$addr), LdMiscFrm,
666                       "ldr", "sh $dst, $addr!", "$addr.base = $base_wb", []>;
667
668 def LDRSH_POST: AI3ldshpo<(outs GPR:$dst, GPR:$base_wb),
669                       (ins GPR:$base,am3offset:$offset), LdMiscFrm,
670                       "ldr", "sh $dst, [$base], $offset", "$base = $base_wb", []>;
671
672 def LDRSB_PRE : AI3ldsbpr<(outs GPR:$dst, GPR:$base_wb),
673                       (ins addrmode3:$addr), LdMiscFrm,
674                       "ldr", "sb $dst, $addr!", "$addr.base = $base_wb", []>;
675
676 def LDRSB_POST: AI3ldsbpo<(outs GPR:$dst, GPR:$base_wb),
677                       (ins GPR:$base,am3offset:$offset), LdMiscFrm,
678                       "ldr", "sb $dst, [$base], $offset", "$base = $base_wb", []>;
679 }
680
681 // Store
682 def STR  : AI2stw<(outs), (ins GPR:$src, addrmode2:$addr), StFrm,
683                "str", " $src, $addr",
684                [(store GPR:$src, addrmode2:$addr)]>;
685
686 // Stores with truncate
687 def STRH : AI3sth<(outs), (ins GPR:$src, addrmode3:$addr), StMiscFrm,
688                "str", "h $src, $addr",
689                [(truncstorei16 GPR:$src, addrmode3:$addr)]>;
690
691 def STRB : AI2stb<(outs), (ins GPR:$src, addrmode2:$addr), StFrm,
692                "str", "b $src, $addr",
693                [(truncstorei8 GPR:$src, addrmode2:$addr)]>;
694
695 // Store doubleword
696 let mayStore = 1 in
697 def STRD : AI3std<(outs), (ins GPR:$src, addrmode3:$addr), StMiscFrm,
698                "str", "d $src, $addr",
699                []>, Requires<[IsARM, HasV5T]>;
700
701 // Indexed stores
702 def STR_PRE  : AI2stwpr<(outs GPR:$base_wb),
703                      (ins GPR:$src, GPR:$base, am2offset:$offset), StFrm,
704                     "str", " $src, [$base, $offset]!", "$base = $base_wb",
705                     [(set GPR:$base_wb,
706                       (pre_store GPR:$src, GPR:$base, am2offset:$offset))]>;
707
708 def STR_POST : AI2stwpo<(outs GPR:$base_wb),
709                      (ins GPR:$src, GPR:$base,am2offset:$offset), StFrm,
710                     "str", " $src, [$base], $offset", "$base = $base_wb",
711                     [(set GPR:$base_wb,
712                       (post_store GPR:$src, GPR:$base, am2offset:$offset))]>;
713
714 def STRH_PRE : AI3sthpr<(outs GPR:$base_wb),
715                      (ins GPR:$src, GPR:$base,am3offset:$offset), StMiscFrm,
716                      "str", "h $src, [$base, $offset]!", "$base = $base_wb",
717                     [(set GPR:$base_wb,
718                       (pre_truncsti16 GPR:$src, GPR:$base,am3offset:$offset))]>;
719
720 def STRH_POST: AI3sthpo<(outs GPR:$base_wb),
721                      (ins GPR:$src, GPR:$base,am3offset:$offset), StMiscFrm,
722                      "str", "h $src, [$base], $offset", "$base = $base_wb",
723                     [(set GPR:$base_wb, (post_truncsti16 GPR:$src,
724                                          GPR:$base, am3offset:$offset))]>;
725
726 def STRB_PRE : AI2stbpr<(outs GPR:$base_wb),
727                      (ins GPR:$src, GPR:$base,am2offset:$offset), StFrm,
728                      "str", "b $src, [$base, $offset]!", "$base = $base_wb",
729                     [(set GPR:$base_wb, (pre_truncsti8 GPR:$src,
730                                          GPR:$base, am2offset:$offset))]>;
731
732 def STRB_POST: AI2stbpo<(outs GPR:$base_wb),
733                      (ins GPR:$src, GPR:$base,am2offset:$offset), StFrm,
734                      "str", "b $src, [$base], $offset", "$base = $base_wb",
735                     [(set GPR:$base_wb, (post_truncsti8 GPR:$src,
736                                          GPR:$base, am2offset:$offset))]>;
737
738 //===----------------------------------------------------------------------===//
739 //  Load / store multiple Instructions.
740 //
741
742 // FIXME: $dst1 should be a def.
743 let mayLoad = 1 in
744 def LDM : AXI4ld<(outs),
745                (ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops),
746                LdMulFrm, "ldm${p}${addr:submode} $addr, $dst1",
747                []>;
748
749 let mayStore = 1 in
750 def STM : AXI4st<(outs),
751                (ins addrmode4:$addr, pred:$p, reglist:$src1, variable_ops),
752                StMulFrm, "stm${p}${addr:submode} $addr, $src1",
753                []>;
754
755 //===----------------------------------------------------------------------===//
756 //  Move Instructions.
757 //
758
759 def MOVr : AsI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm,
760                  "mov", " $dst, $src", []>, UnaryDP;
761 def MOVs : AsI1<0b1101, (outs GPR:$dst), (ins so_reg:$src), DPSoRegFrm,
762                  "mov", " $dst, $src", [(set GPR:$dst, so_reg:$src)]>, UnaryDP;
763
764 let isReMaterializable = 1 in
765 def MOVi : AsI1<0b1101, (outs GPR:$dst), (ins so_imm:$src), DPFrm,
766                  "mov", " $dst, $src", [(set GPR:$dst, so_imm:$src)]>, UnaryDP;
767
768 def MOVrx : AsI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm,
769                  "mov", " $dst, $src, rrx",
770                  [(set GPR:$dst, (ARMrrx GPR:$src))]>, UnaryDP;
771
772 // These aren't really mov instructions, but we have to define them this way
773 // due to flag operands.
774
775 let Defs = [CPSR] in {
776 def MOVsrl_flag : AI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm,
777                       "mov", "s $dst, $src, lsr #1",
778                       [(set GPR:$dst, (ARMsrl_flag GPR:$src))]>, UnaryDP;
779 def MOVsra_flag : AI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm,
780                       "mov", "s $dst, $src, asr #1",
781                       [(set GPR:$dst, (ARMsra_flag GPR:$src))]>, UnaryDP;
782 }
783
784 //===----------------------------------------------------------------------===//
785 //  Extend Instructions.
786 //
787
788 // Sign extenders
789
790 defm SXTB  : AI_unary_rrot<0b01101010,
791                            "sxtb", UnOpFrag<(sext_inreg node:$Src, i8)>>;
792 defm SXTH  : AI_unary_rrot<0b01101011,
793                            "sxth", UnOpFrag<(sext_inreg node:$Src, i16)>>;
794
795 defm SXTAB : AI_bin_rrot<0b01101010,
796                "sxtab", BinOpFrag<(add node:$LHS, (sext_inreg node:$RHS, i8))>>;
797 defm SXTAH : AI_bin_rrot<0b01101011,
798                "sxtah", BinOpFrag<(add node:$LHS, (sext_inreg node:$RHS,i16))>>;
799
800 // TODO: SXT(A){B|H}16
801
802 // Zero extenders
803
804 let AddedComplexity = 16 in {
805 defm UXTB   : AI_unary_rrot<0b01101110,
806                             "uxtb"  , UnOpFrag<(and node:$Src, 0x000000FF)>>;
807 defm UXTH   : AI_unary_rrot<0b01101111,
808                             "uxth"  , UnOpFrag<(and node:$Src, 0x0000FFFF)>>;
809 defm UXTB16 : AI_unary_rrot<0b01101100,
810                             "uxtb16", UnOpFrag<(and node:$Src, 0x00FF00FF)>>;
811
812 def : ARMV6Pat<(and (shl GPR:$Src, 8), 0xFF00FF),
813                (UXTB16r_rot GPR:$Src, 24)>;
814 def : ARMV6Pat<(and (srl GPR:$Src, 8), 0xFF00FF),
815                (UXTB16r_rot GPR:$Src, 8)>;
816
817 defm UXTAB : AI_bin_rrot<0b01101110, "uxtab",
818                         BinOpFrag<(add node:$LHS, (and node:$RHS, 0x00FF))>>;
819 defm UXTAH : AI_bin_rrot<0b01101111, "uxtah",
820                         BinOpFrag<(add node:$LHS, (and node:$RHS, 0xFFFF))>>;
821 }
822
823 // This isn't safe in general, the add is two 16-bit units, not a 32-bit add.
824 //defm UXTAB16 : xxx<"uxtab16", 0xff00ff>;
825
826 // TODO: UXT(A){B|H}16
827
828 //===----------------------------------------------------------------------===//
829 //  Arithmetic Instructions.
830 //
831
832 defm ADD  : AsI1_bin_irs<0b0100, "add",
833                          BinOpFrag<(add  node:$LHS, node:$RHS)>>;
834 defm SUB  : AsI1_bin_irs<0b0010, "sub",
835                          BinOpFrag<(sub  node:$LHS, node:$RHS)>>;
836
837 // ADD and SUB with 's' bit set.
838 defm ADDS : ASI1_bin_s_irs<0b0100, "add",
839                            BinOpFrag<(addc node:$LHS, node:$RHS)>>;
840 defm SUBS : ASI1_bin_s_irs<0b0010, "sub",
841                            BinOpFrag<(subc node:$LHS, node:$RHS)>>;
842
843 // FIXME: Do not allow ADC / SBC to be predicated for now.
844 defm ADC  : AsXI1_bin_c_irs<0b0101, "adc",
845                             BinOpFrag<(adde node:$LHS, node:$RHS)>>;
846 defm SBC  : AsXI1_bin_c_irs<0b0110, "sbc",
847                             BinOpFrag<(sube node:$LHS, node:$RHS)>>;
848
849 // These don't define reg/reg forms, because they are handled above.
850 def RSBri : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPFrm,
851                   "rsb", " $dst, $a, $b",
852                   [(set GPR:$dst, (sub so_imm:$b, GPR:$a))]>;
853
854 def RSBrs : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm,
855                   "rsb", " $dst, $a, $b",
856                   [(set GPR:$dst, (sub so_reg:$b, GPR:$a))]>;
857
858 // RSB with 's' bit set.
859 let Defs = [CPSR] in {
860 def RSBSri : AI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPFrm,
861                  "rsb", "s $dst, $a, $b",
862                  [(set GPR:$dst, (subc so_imm:$b, GPR:$a))]>;
863 def RSBSrs : AI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm,
864                  "rsb", "s $dst, $a, $b",
865                  [(set GPR:$dst, (subc so_reg:$b, GPR:$a))]>;
866 }
867
868 // FIXME: Do not allow RSC to be predicated for now. But they can set CPSR.
869 let Uses = [CPSR] in {
870 def RSCri : AXI1<0b0111, (outs GPR:$dst), (ins GPR:$a, so_imm:$b, cc_out:$s),
871                  DPFrm, "rsc${s} $dst, $a, $b",
872                  [(set GPR:$dst, (sube so_imm:$b, GPR:$a))]>;
873 def RSCrs : AXI1<0b0111, (outs GPR:$dst), (ins GPR:$a, so_reg:$b, cc_out:$s),
874                  DPSoRegFrm, "rsc${s} $dst, $a, $b",
875                  [(set GPR:$dst, (sube so_reg:$b, GPR:$a))]>;
876 }
877
878 // (sub X, imm) gets canonicalized to (add X, -imm).  Match this form.
879 def : ARMPat<(add    GPR:$src, so_imm_neg:$imm),
880              (SUBri  GPR:$src, so_imm_neg:$imm)>;
881
882 //def : ARMPat<(addc   GPR:$src, so_imm_neg:$imm),
883 //             (SUBSri GPR:$src, so_imm_neg:$imm)>;
884 //def : ARMPat<(adde   GPR:$src, so_imm_neg:$imm),
885 //             (SBCri  GPR:$src, so_imm_neg:$imm)>;
886
887 // Note: These are implemented in C++ code, because they have to generate
888 // ADD/SUBrs instructions, which use a complex pattern that a xform function
889 // cannot produce.
890 // (mul X, 2^n+1) -> (add (X << n), X)
891 // (mul X, 2^n-1) -> (rsb X, (X << n))
892
893
894 //===----------------------------------------------------------------------===//
895 //  Bitwise Instructions.
896 //
897
898 defm AND   : AsI1_bin_irs<0b0000, "and",
899                           BinOpFrag<(and node:$LHS, node:$RHS)>>;
900 defm ORR   : AsI1_bin_irs<0b1100, "orr",
901                           BinOpFrag<(or  node:$LHS, node:$RHS)>>;
902 defm EOR   : AsI1_bin_irs<0b0001, "eor",
903                           BinOpFrag<(xor node:$LHS, node:$RHS)>>;
904 defm BIC   : AsI1_bin_irs<0b1110, "bic",
905                           BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
906
907 def  MVNr  : AsI1<0b1111, (outs GPR:$dst), (ins GPR:$src), DPFrm,
908                   "mvn", " $dst, $src",
909                   [(set GPR:$dst, (not GPR:$src))]>, UnaryDP;
910 def  MVNs  : AsI1<0b1111, (outs GPR:$dst), (ins so_reg:$src), DPSoRegFrm,
911                   "mvn", " $dst, $src",
912                   [(set GPR:$dst, (not so_reg:$src))]>, UnaryDP;
913 let isReMaterializable = 1 in
914 def  MVNi  : AsI1<0b1111, (outs GPR:$dst), (ins so_imm:$imm), DPFrm,
915                   "mvn", " $dst, $imm",
916                   [(set GPR:$dst, so_imm_not:$imm)]>,UnaryDP;
917
918 def : ARMPat<(and   GPR:$src, so_imm_not:$imm),
919              (BICri GPR:$src, so_imm_not:$imm)>;
920
921 //===----------------------------------------------------------------------===//
922 //  Multiply Instructions.
923 //
924
925 def MUL   : AsMul1I<0b0000000, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
926                     "mul", " $dst, $a, $b",
927                    [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>;
928
929 def MLA   : AsMul1I<0b0000001, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c),
930                     "mla", " $dst, $a, $b, $c",
931                    [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>;
932
933 // Extra precision multiplies with low / high results
934 def SMULL : AsMul1I<0b0000110, (outs GPR:$ldst, GPR:$hdst),
935                                (ins GPR:$a, GPR:$b),
936                     "smull", " $ldst, $hdst, $a, $b", []>;
937
938 def UMULL : AsMul1I<0b0000100, (outs GPR:$ldst, GPR:$hdst),
939                                (ins GPR:$a, GPR:$b),
940                     "umull", " $ldst, $hdst, $a, $b", []>;
941
942 // Multiply + accumulate
943 def SMLAL : AsMul1I<0b0000111, (outs GPR:$ldst, GPR:$hdst),
944                                (ins GPR:$a, GPR:$b),
945                     "smlal", " $ldst, $hdst, $a, $b", []>;
946
947 def UMLAL : AsMul1I<0b0000101, (outs GPR:$ldst, GPR:$hdst),
948                                (ins GPR:$a, GPR:$b),
949                     "umlal", " $ldst, $hdst, $a, $b", []>;
950
951 def UMAAL : AMul1I <0b0000010, (outs GPR:$ldst, GPR:$hdst),
952                                (ins GPR:$a, GPR:$b),
953                     "umaal", " $ldst, $hdst, $a, $b", []>,
954                     Requires<[IsARM, HasV6]>;
955
956 // Most significant word multiply
957 def SMMUL : AMul2I <0b0111010, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
958                "smmul", " $dst, $a, $b",
959                [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>,
960             Requires<[IsARM, HasV6]> {
961   let Inst{7-4}   = 0b0001;
962   let Inst{15-12} = 0b1111;
963 }
964
965 def SMMLA : AMul2I <0b0111010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c),
966                "smmla", " $dst, $a, $b, $c",
967                [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR:$c))]>,
968             Requires<[IsARM, HasV6]> {
969   let Inst{7-4}   = 0b0001;
970 }
971
972
973 def SMMLS : AMul2I <0b0111010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c),
974                "smmls", " $dst, $a, $b, $c",
975                [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR:$b)))]>,
976             Requires<[IsARM, HasV6]> {
977   let Inst{7-4}   = 0b1101;
978 }
979
980 multiclass AI_smul<string opc, PatFrag opnode> {
981   def BB : AMulxyI<0b0001011, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
982               !strconcat(opc, "bb"), " $dst, $a, $b",
983               [(set GPR:$dst, (opnode (sext_inreg GPR:$a, i16),
984                                       (sext_inreg GPR:$b, i16)))]>,
985            Requires<[IsARM, HasV5TE]> {
986              let Inst{5} = 0;
987              let Inst{6} = 0;
988            }
989
990   def BT : AMulxyI<0b0001011, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
991               !strconcat(opc, "bt"), " $dst, $a, $b",
992               [(set GPR:$dst, (opnode (sext_inreg GPR:$a, i16),
993                                       (sra GPR:$b, 16)))]>,
994            Requires<[IsARM, HasV5TE]> {
995              let Inst{5} = 0;
996              let Inst{6} = 1;
997            }
998
999   def TB : AMulxyI<0b0001011, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
1000               !strconcat(opc, "tb"), " $dst, $a, $b",
1001               [(set GPR:$dst, (opnode (sra GPR:$a, 16),
1002                                       (sext_inreg GPR:$b, i16)))]>,
1003            Requires<[IsARM, HasV5TE]> {
1004              let Inst{5} = 1;
1005              let Inst{6} = 0;
1006            }
1007
1008   def TT : AMulxyI<0b0001011, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
1009               !strconcat(opc, "tt"), " $dst, $a, $b",
1010               [(set GPR:$dst, (opnode (sra GPR:$a, 16),
1011                                       (sra GPR:$b, 16)))]>,
1012             Requires<[IsARM, HasV5TE]> {
1013              let Inst{5} = 1;
1014              let Inst{6} = 1;
1015            }
1016
1017   def WB : AMulxyI<0b0001001, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
1018               !strconcat(opc, "wb"), " $dst, $a, $b",
1019               [(set GPR:$dst, (sra (opnode GPR:$a,
1020                                     (sext_inreg GPR:$b, i16)), 16))]>,
1021            Requires<[IsARM, HasV5TE]> {
1022              let Inst{5} = 1;
1023              let Inst{6} = 0;
1024            }
1025
1026   def WT : AMulxyI<0b0001001, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
1027               !strconcat(opc, "wt"), " $dst, $a, $b",
1028               [(set GPR:$dst, (sra (opnode GPR:$a,
1029                                     (sra GPR:$b, 16)), 16))]>,
1030             Requires<[IsARM, HasV5TE]> {
1031              let Inst{5} = 1;
1032              let Inst{6} = 1;
1033            }
1034 }
1035
1036
1037 multiclass AI_smla<string opc, PatFrag opnode> {
1038   def BB : AMulxyI<0b0001000, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc),
1039               !strconcat(opc, "bb"), " $dst, $a, $b, $acc",
1040               [(set GPR:$dst, (add GPR:$acc,
1041                                (opnode (sext_inreg GPR:$a, i16),
1042                                        (sext_inreg GPR:$b, i16))))]>,
1043            Requires<[IsARM, HasV5TE]> {
1044              let Inst{5} = 0;
1045              let Inst{6} = 0;
1046            }
1047
1048   def BT : AMulxyI<0b0001000, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc),
1049               !strconcat(opc, "bt"), " $dst, $a, $b, $acc",
1050               [(set GPR:$dst, (add GPR:$acc, (opnode (sext_inreg GPR:$a, i16),
1051                                                      (sra GPR:$b, 16))))]>,
1052            Requires<[IsARM, HasV5TE]> {
1053              let Inst{5} = 0;
1054              let Inst{6} = 1;
1055            }
1056
1057   def TB : AMulxyI<0b0001000, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc),
1058               !strconcat(opc, "tb"), " $dst, $a, $b, $acc",
1059               [(set GPR:$dst, (add GPR:$acc, (opnode (sra GPR:$a, 16),
1060                                                  (sext_inreg GPR:$b, i16))))]>,
1061            Requires<[IsARM, HasV5TE]> {
1062              let Inst{5} = 1;
1063              let Inst{6} = 0;
1064            }
1065
1066   def TT : AMulxyI<0b0001000, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc),
1067               !strconcat(opc, "tt"), " $dst, $a, $b, $acc",
1068               [(set GPR:$dst, (add GPR:$acc, (opnode (sra GPR:$a, 16),
1069                                                      (sra GPR:$b, 16))))]>,
1070             Requires<[IsARM, HasV5TE]> {
1071              let Inst{5} = 1;
1072              let Inst{6} = 1;
1073            }
1074
1075   def WB : AMulxyI<0b0001001, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc),
1076               !strconcat(opc, "wb"), " $dst, $a, $b, $acc",
1077               [(set GPR:$dst, (add GPR:$acc, (sra (opnode GPR:$a,
1078                                             (sext_inreg GPR:$b, i16)), 16)))]>,
1079            Requires<[IsARM, HasV5TE]> {
1080              let Inst{5} = 0;
1081              let Inst{6} = 0;
1082            }
1083
1084   def WT : AMulxyI<0b0001001, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc),
1085               !strconcat(opc, "wt"), " $dst, $a, $b, $acc",
1086               [(set GPR:$dst, (add GPR:$acc, (sra (opnode GPR:$a,
1087                                                    (sra GPR:$b, 16)), 16)))]>,
1088             Requires<[IsARM, HasV5TE]> {
1089              let Inst{5} = 0;
1090              let Inst{6} = 1;
1091            }
1092 }
1093
1094 defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>;
1095 defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>;
1096
1097 // TODO: Halfword multiple accumulate long: SMLAL<x><y>
1098 // TODO: Dual halfword multiple: SMUAD, SMUSD, SMLAD, SMLSD, SMLALD, SMLSLD
1099
1100 //===----------------------------------------------------------------------===//
1101 //  Misc. Arithmetic Instructions.
1102 //
1103
1104 def CLZ  : AMiscA1I<0b000010110, (outs GPR:$dst), (ins GPR:$src),
1105               "clz", " $dst, $src",
1106               [(set GPR:$dst, (ctlz GPR:$src))]>, Requires<[IsARM, HasV5T]> {
1107   let Inst{7-4}   = 0b0001;
1108   let Inst{11-8}  = 0b1111;
1109   let Inst{19-16} = 0b1111;
1110 }
1111
1112 def REV  : AMiscA1I<0b01101011, (outs GPR:$dst), (ins GPR:$src),
1113               "rev", " $dst, $src",
1114               [(set GPR:$dst, (bswap GPR:$src))]>, Requires<[IsARM, HasV6]> {
1115   let Inst{7-4}   = 0b0011;
1116   let Inst{11-8}  = 0b1111;
1117   let Inst{19-16} = 0b1111;
1118 }
1119
1120 def REV16 : AMiscA1I<0b01101011, (outs GPR:$dst), (ins GPR:$src),
1121                "rev16", " $dst, $src",
1122                [(set GPR:$dst,
1123                    (or (and (srl GPR:$src, 8), 0xFF),
1124                        (or (and (shl GPR:$src, 8), 0xFF00),
1125                            (or (and (srl GPR:$src, 8), 0xFF0000),
1126                                (and (shl GPR:$src, 8), 0xFF000000)))))]>,
1127                Requires<[IsARM, HasV6]> {
1128   let Inst{7-4}   = 0b1011;
1129   let Inst{11-8}  = 0b1111;
1130   let Inst{19-16} = 0b1111;
1131 }
1132
1133 def REVSH : AMiscA1I<0b01101111, (outs GPR:$dst), (ins GPR:$src),
1134                "revsh", " $dst, $src",
1135                [(set GPR:$dst,
1136                   (sext_inreg
1137                     (or (srl (and GPR:$src, 0xFF00), 8),
1138                         (shl GPR:$src, 8)), i16))]>,
1139                Requires<[IsARM, HasV6]> {
1140   let Inst{7-4}   = 0b1011;
1141   let Inst{11-8}  = 0b1111;
1142   let Inst{19-16} = 0b1111;
1143 }
1144
1145 def PKHBT : AMiscA1I<0b01101000, (outs GPR:$dst),
1146                                  (ins GPR:$src1, GPR:$src2, i32imm:$shamt),
1147                "pkhbt", " $dst, $src1, $src2, LSL $shamt",
1148                [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF),
1149                                    (and (shl GPR:$src2, (i32 imm:$shamt)),
1150                                         0xFFFF0000)))]>,
1151                Requires<[IsARM, HasV6]> {
1152   let Inst{6-4} = 0b001;
1153 }
1154
1155 // Alternate cases for PKHBT where identities eliminate some nodes.
1156 def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (and GPR:$src2, 0xFFFF0000)),
1157                (PKHBT GPR:$src1, GPR:$src2, 0)>;
1158 def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (shl GPR:$src2, imm16_31:$shamt)),
1159                (PKHBT GPR:$src1, GPR:$src2, imm16_31:$shamt)>;
1160
1161
1162 def PKHTB : AMiscA1I<0b01101000, (outs GPR:$dst),
1163                                  (ins GPR:$src1, GPR:$src2, i32imm:$shamt),
1164                "pkhtb", " $dst, $src1, $src2, ASR $shamt",
1165                [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF0000),
1166                                    (and (sra GPR:$src2, imm16_31:$shamt),
1167                                         0xFFFF)))]>, Requires<[IsARM, HasV6]> {
1168   let Inst{6-4} = 0b101;
1169 }
1170
1171 // Alternate cases for PKHTB where identities eliminate some nodes.  Note that
1172 // a shift amount of 0 is *not legal* here, it is PKHBT instead.
1173 def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (srl GPR:$src2, 16)),
1174                (PKHTB GPR:$src1, GPR:$src2, 16)>;
1175 def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000),
1176                    (and (srl GPR:$src2, imm1_15:$shamt), 0xFFFF)),
1177                (PKHTB GPR:$src1, GPR:$src2, imm1_15:$shamt)>;
1178
1179 //===----------------------------------------------------------------------===//
1180 //  Comparison Instructions...
1181 //
1182
1183 defm CMP  : AI1_cmp_irs<0b1010, "cmp",
1184                         BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>;
1185 defm CMN  : AI1_cmp_irs<0b1011, "cmn",
1186                         BinOpFrag<(ARMcmp node:$LHS,(ineg node:$RHS))>>;
1187
1188 // Note that TST/TEQ don't set all the same flags that CMP does!
1189 defm TST  : AI1_cmp_irs<0b1000, "tst",
1190                         BinOpFrag<(ARMcmpNZ (and node:$LHS, node:$RHS), 0)>>;
1191 defm TEQ  : AI1_cmp_irs<0b1001, "teq",
1192                         BinOpFrag<(ARMcmpNZ (xor node:$LHS, node:$RHS), 0)>>;
1193
1194 defm CMPnz : AI1_cmp_irs<0b1010, "cmp",
1195                          BinOpFrag<(ARMcmpNZ node:$LHS, node:$RHS)>>;
1196 defm CMNnz : AI1_cmp_irs<0b1011, "cmn",
1197                          BinOpFrag<(ARMcmpNZ node:$LHS,(ineg node:$RHS))>>;
1198
1199 def : ARMPat<(ARMcmp GPR:$src, so_imm_neg:$imm),
1200              (CMNri  GPR:$src, so_imm_neg:$imm)>;
1201
1202 def : ARMPat<(ARMcmpNZ GPR:$src, so_imm_neg:$imm),
1203              (CMNri  GPR:$src, so_imm_neg:$imm)>;
1204
1205
1206 // Conditional moves
1207 // FIXME: should be able to write a pattern for ARMcmov, but can't use
1208 // a two-value operand where a dag node expects two operands. :( 
1209 def MOVCCr : AI1<0b1101, (outs GPR:$dst), (ins GPR:$false, GPR:$true), DPFrm,
1210                 "mov", " $dst, $true",
1211       [/*(set GPR:$dst, (ARMcmov GPR:$false, GPR:$true, imm:$cc, CCR:$ccr))*/]>,
1212                 RegConstraint<"$false = $dst">, UnaryDP;
1213
1214 def MOVCCs : AI1<0b1101, (outs GPR:$dst),
1215                         (ins GPR:$false, so_reg:$true), DPSoRegFrm,
1216                 "mov", " $dst, $true",
1217    [/*(set GPR:$dst, (ARMcmov GPR:$false, so_reg:$true, imm:$cc, CCR:$ccr))*/]>,
1218                 RegConstraint<"$false = $dst">, UnaryDP;
1219
1220 def MOVCCi : AI1<0b1101, (outs GPR:$dst),
1221                         (ins GPR:$false, so_imm:$true), DPFrm,
1222                 "mov", " $dst, $true",
1223    [/*(set GPR:$dst, (ARMcmov GPR:$false, so_imm:$true, imm:$cc, CCR:$ccr))*/]>,
1224                 RegConstraint<"$false = $dst">, UnaryDP;
1225
1226
1227 // LEApcrel - Load a pc-relative address into a register without offending the
1228 // assembler.
1229 def LEApcrel : AXI1<0x0, (outs GPR:$dst), (ins i32imm:$label, pred:$p), Pseudo,
1230                    !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(",
1231                                          "${:private}PCRELL${:uid}+8))\n"),
1232                               !strconcat("${:private}PCRELL${:uid}:\n\t",
1233                                          "add$p $dst, pc, #PCRELV${:uid}")),
1234                    []>;
1235
1236 def LEApcrelJT : AXI1<0x0, (outs GPR:$dst), (ins i32imm:$label, i32imm:$id, pred:$p),
1237           Pseudo,
1238           !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(",
1239                                          "${:private}PCRELL${:uid}+8))\n"),
1240                               !strconcat("${:private}PCRELL${:uid}:\n\t",
1241                                          "add$p $dst, pc, #PCRELV${:uid}")),
1242                    []>;
1243
1244 //===----------------------------------------------------------------------===//
1245 // TLS Instructions
1246 //
1247
1248 // __aeabi_read_tp preserves the registers r1-r3.
1249 let isCall = 1,
1250   Defs = [R0, R12, LR, CPSR] in {
1251   def TPsoft : ABXI<0b1011, (outs), (ins),
1252                "bl __aeabi_read_tp",
1253                [(set R0, ARMthread_pointer)]>;
1254 }
1255
1256 //===----------------------------------------------------------------------===//
1257 // Non-Instruction Patterns
1258 //
1259
1260 // ConstantPool, GlobalAddress, and JumpTable
1261 def : ARMPat<(ARMWrapper  tglobaladdr :$dst), (LEApcrel tglobaladdr :$dst)>;
1262 def : ARMPat<(ARMWrapper  tconstpool  :$dst), (LEApcrel tconstpool  :$dst)>;
1263 def : ARMPat<(ARMWrapperJT tjumptable:$dst, imm:$id),
1264              (LEApcrelJT tjumptable:$dst, imm:$id)>;
1265
1266 // Large immediate handling.
1267
1268 // Two piece so_imms.
1269 let isReMaterializable = 1 in
1270 def MOVi2pieces : AI1x2<(outs GPR:$dst), (ins so_imm2part:$src), Pseudo,
1271                          "mov", " $dst, $src",
1272                          [(set GPR:$dst, so_imm2part:$src)]>;
1273
1274 def : ARMPat<(or GPR:$LHS, so_imm2part:$RHS),
1275               (ORRri (ORRri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
1276                      (so_imm2part_2 imm:$RHS))>;
1277 def : ARMPat<(xor GPR:$LHS, so_imm2part:$RHS),
1278               (EORri (EORri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
1279                      (so_imm2part_2 imm:$RHS))>;
1280
1281 // TODO: add,sub,and, 3-instr forms?
1282
1283
1284 // Direct calls
1285 def : ARMPat<(ARMcall texternalsym:$func), (BL texternalsym:$func)>;
1286
1287 // zextload i1 -> zextload i8
1288 def : ARMPat<(zextloadi1 addrmode2:$addr),  (LDRB addrmode2:$addr)>;
1289
1290 // extload -> zextload
1291 def : ARMPat<(extloadi1  addrmode2:$addr),  (LDRB addrmode2:$addr)>;
1292 def : ARMPat<(extloadi8  addrmode2:$addr),  (LDRB addrmode2:$addr)>;
1293 def : ARMPat<(extloadi16 addrmode3:$addr),  (LDRH addrmode3:$addr)>;
1294
1295 def : ARMPat<(extloadi8  addrmodepc:$addr), (PICLDRB addrmodepc:$addr)>;
1296 def : ARMPat<(extloadi16 addrmodepc:$addr), (PICLDRH addrmodepc:$addr)>;
1297
1298 // smul* and smla*
1299 def : ARMV5TEPat<(mul (sra (shl GPR:$a, 16), 16), (sra (shl GPR:$b, 16), 16)),
1300                  (SMULBB GPR:$a, GPR:$b)>;
1301 def : ARMV5TEPat<(mul sext_16_node:$a, sext_16_node:$b),
1302                  (SMULBB GPR:$a, GPR:$b)>;
1303 def : ARMV5TEPat<(mul (sra (shl GPR:$a, 16), 16), (sra GPR:$b, 16)),
1304                  (SMULBT GPR:$a, GPR:$b)>;
1305 def : ARMV5TEPat<(mul sext_16_node:$a, (sra GPR:$b, 16)),
1306                  (SMULBT GPR:$a, GPR:$b)>;
1307 def : ARMV5TEPat<(mul (sra GPR:$a, 16), (sra (shl GPR:$b, 16), 16)),
1308                  (SMULTB GPR:$a, GPR:$b)>;
1309 def : ARMV5TEPat<(mul (sra GPR:$a, 16), sext_16_node:$b),
1310                 (SMULTB GPR:$a, GPR:$b)>;
1311 def : ARMV5TEPat<(sra (mul GPR:$a, (sra (shl GPR:$b, 16), 16)), 16),
1312                  (SMULWB GPR:$a, GPR:$b)>;
1313 def : ARMV5TEPat<(sra (mul GPR:$a, sext_16_node:$b), 16),
1314                  (SMULWB GPR:$a, GPR:$b)>;
1315
1316 def : ARMV5TEPat<(add GPR:$acc,
1317                       (mul (sra (shl GPR:$a, 16), 16),
1318                            (sra (shl GPR:$b, 16), 16))),
1319                  (SMLABB GPR:$a, GPR:$b, GPR:$acc)>;
1320 def : ARMV5TEPat<(add GPR:$acc,
1321                       (mul sext_16_node:$a, sext_16_node:$b)),
1322                  (SMLABB GPR:$a, GPR:$b, GPR:$acc)>;
1323 def : ARMV5TEPat<(add GPR:$acc,
1324                       (mul (sra (shl GPR:$a, 16), 16), (sra GPR:$b, 16))),
1325                  (SMLABT GPR:$a, GPR:$b, GPR:$acc)>;
1326 def : ARMV5TEPat<(add GPR:$acc,
1327                       (mul sext_16_node:$a, (sra GPR:$b, 16))),
1328                  (SMLABT GPR:$a, GPR:$b, GPR:$acc)>;
1329 def : ARMV5TEPat<(add GPR:$acc,
1330                       (mul (sra GPR:$a, 16), (sra (shl GPR:$b, 16), 16))),
1331                  (SMLATB GPR:$a, GPR:$b, GPR:$acc)>;
1332 def : ARMV5TEPat<(add GPR:$acc,
1333                       (mul (sra GPR:$a, 16), sext_16_node:$b)),
1334                  (SMLATB GPR:$a, GPR:$b, GPR:$acc)>;
1335 def : ARMV5TEPat<(add GPR:$acc,
1336                       (sra (mul GPR:$a, (sra (shl GPR:$b, 16), 16)), 16)),
1337                  (SMLAWB GPR:$a, GPR:$b, GPR:$acc)>;
1338 def : ARMV5TEPat<(add GPR:$acc,
1339                       (sra (mul GPR:$a, sext_16_node:$b), 16)),
1340                  (SMLAWB GPR:$a, GPR:$b, GPR:$acc)>;
1341
1342 //===----------------------------------------------------------------------===//
1343 // Thumb Support
1344 //
1345
1346 include "ARMInstrThumb.td"
1347
1348 //===----------------------------------------------------------------------===//
1349 // Floating Point Support
1350 //
1351
1352 include "ARMInstrVFP.td"