Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 1 | //===- ARMInstrInfo.td - Target Description for ARM Target ----------------===// |
| 2 | // |
| 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 | |
| 15 | |
| 16 | |
| 17 | //===----------------------------------------------------------------------===// |
| 18 | // Instructions |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | |
| 21 | class InstARM<dag ops, string asmstr, list<dag> pattern> : Instruction { |
| 22 | let Namespace = "ARM"; |
| 23 | |
| 24 | dag OperandList = ops; |
| 25 | let AsmString = asmstr; |
| 26 | let Pattern = pattern; |
| 27 | } |
| 28 | |
| 29 | def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>; |
| 30 | def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq, [SDNPHasChain]>; |
| 31 | def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq, [SDNPHasChain]>; |
| 32 | |
| 33 | def SDT_ARMRetFlag : SDTypeProfile<0, 0, []>; |
| 34 | def retflag : SDNode<"ARMISD::RET_FLAG", SDT_ARMRetFlag, |
| 35 | [SDNPHasChain, SDNPOptInFlag]>; |
| 36 | |
| 37 | def ADJCALLSTACKUP : InstARM<(ops i32imm:$amt), |
| 38 | "!ADJCALLSTACKUP $amt", |
| 39 | [(callseq_end imm:$amt)]>; |
| 40 | |
| 41 | def ADJCALLSTACKDOWN : InstARM<(ops i32imm:$amt), |
| 42 | "!ADJCALLSTACKDOWN $amt", |
| 43 | [(callseq_start imm:$amt)]>; |
| 44 | |
Rafael Espindola | dc124a2 | 2006-05-18 21:45:49 +0000 | [diff] [blame^] | 45 | def BX: InstARM<(ops), "bx", [(retflag)]>; |
| 46 | |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 47 | def ldr : InstARM<(ops IntRegs:$dst, IntRegs:$addr), |
| 48 | "ldr $dst, [$addr]", |
| 49 | [(set IntRegs:$dst, (load IntRegs:$addr))]>; |
| 50 | |
| 51 | def str : InstARM<(ops IntRegs:$src, IntRegs:$addr), |
| 52 | "str $src, [$addr]", |
| 53 | [(store IntRegs:$src, IntRegs:$addr)]>; |
| 54 | |
Rafael Espindola | dc124a2 | 2006-05-18 21:45:49 +0000 | [diff] [blame^] | 55 | def movrr : InstARM<(ops IntRegs:$dst, IntRegs:$src), |
| 56 | "mov $dst, $src", []>; |
| 57 | |
| 58 | def movri : InstARM<(ops IntRegs:$dst, i32imm:$src), |
| 59 | "mov $dst, $src", [(set IntRegs:$dst, imm:$src)]>; |