Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 1 | //===- ARMInstrFormats.td - ARM Instruction Formats --*- 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 | //===----------------------------------------------------------------------===// |
| 11 | // |
| 12 | // ARM Instruction Format Definitions. |
| 13 | // |
| 14 | |
| 15 | // Format specifies the encoding used by the instruction. This is part of the |
| 16 | // ad-hoc solution used to emit machine instruction encodings by our machine |
| 17 | // code emitter. |
| 18 | class Format<bits<5> val> { |
| 19 | bits<5> Value = val; |
| 20 | } |
| 21 | |
| 22 | def Pseudo : Format<1>; |
| 23 | def MulFrm : Format<2>; |
| 24 | def MulSMLAW : Format<3>; |
| 25 | def MulSMULW : Format<4>; |
| 26 | def MulSMLA : Format<5>; |
| 27 | def MulSMUL : Format<6>; |
| 28 | def Branch : Format<7>; |
| 29 | def BranchMisc : Format<8>; |
| 30 | |
Evan Cheng | 4c7e67a | 2008-09-13 01:35:33 +0000 | [diff] [blame] | 31 | def DPRdIm : Format<9>; |
| 32 | def DPRdReg : Format<10>; |
| 33 | def DPRdSoReg : Format<11>; |
| 34 | def DPRdMisc : Format<12>; |
| 35 | def DPRnIm : Format<13>; |
| 36 | def DPRnReg : Format<14>; |
| 37 | def DPRnSoReg : Format<15>; |
| 38 | def DPRIm : Format<16>; |
| 39 | def DPRReg : Format<17>; |
| 40 | def DPRSoReg : Format<18>; |
| 41 | def DPRImS : Format<19>; |
| 42 | def DPRRegS : Format<20>; |
| 43 | def DPRSoRegS : Format<21>; |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 44 | |
Evan Cheng | 4c7e67a | 2008-09-13 01:35:33 +0000 | [diff] [blame] | 45 | def LdFrm : Format<22>; |
| 46 | def StFrm : Format<23>; |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 47 | |
Evan Cheng | 4c7e67a | 2008-09-13 01:35:33 +0000 | [diff] [blame] | 48 | def ArithMisc : Format<24>; |
| 49 | def ThumbFrm : Format<25>; |
| 50 | def VFPFrm : Format<26>; |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 51 | |
| 52 | |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 53 | //===----------------------------------------------------------------------===// |
| 54 | |
| 55 | // ARM Instruction templates. |
| 56 | // |
| 57 | |
| 58 | class InstARM<bits<4> opcod, AddrMode am, SizeFlagVal sz, IndexMode im, |
| 59 | Format f, string cstr> |
| 60 | : Instruction { |
Evan Cheng | d075035 | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 61 | field bits<32> Inst; |
| 62 | |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 63 | let Namespace = "ARM"; |
| 64 | |
| 65 | bits<4> Opcode = opcod; |
| 66 | AddrMode AM = am; |
| 67 | bits<4> AddrModeBits = AM.Value; |
| 68 | |
| 69 | SizeFlagVal SZ = sz; |
| 70 | bits<3> SizeFlag = SZ.Value; |
| 71 | |
| 72 | IndexMode IM = im; |
| 73 | bits<2> IndexModeBits = IM.Value; |
| 74 | |
| 75 | Format F = f; |
| 76 | bits<5> Form = F.Value; |
| 77 | |
| 78 | let Constraints = cstr; |
| 79 | } |
| 80 | |
| 81 | class PseudoInst<dag oops, dag iops, string asm, list<dag> pattern> |
| 82 | : InstARM<0, AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, ""> { |
| 83 | let OutOperandList = oops; |
| 84 | let InOperandList = iops; |
| 85 | let AsmString = asm; |
| 86 | let Pattern = pattern; |
| 87 | } |
| 88 | |
| 89 | // Almost all ARM instructions are predicable. |
| 90 | class I<bits<4> opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz, |
| 91 | IndexMode im, Format f, string opc, string asm, string cstr, |
| 92 | list<dag> pattern> |
| 93 | : InstARM<opcod, am, sz, im, f, cstr> { |
| 94 | let OutOperandList = oops; |
| 95 | let InOperandList = !con(iops, (ops pred:$p)); |
| 96 | let AsmString = !strconcat(opc, !strconcat("${p}", asm)); |
| 97 | let Pattern = pattern; |
| 98 | list<Predicate> Predicates = [IsARM]; |
| 99 | } |
| 100 | |
| 101 | // Same as I except it can optionally modify CPSR. Note it's modeled as |
| 102 | // an input operand since by default it's a zero register. It will |
| 103 | // become an implicit def once it's "flipped". |
| 104 | class sI<bits<4> opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz, |
| 105 | IndexMode im, Format f, string opc, string asm, string cstr, |
| 106 | list<dag> pattern> |
| 107 | : InstARM<opcod, am, sz, im, f, cstr> { |
| 108 | let OutOperandList = oops; |
| 109 | let InOperandList = !con(iops, (ops pred:$p, cc_out:$s)); |
| 110 | let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm)); |
| 111 | let Pattern = pattern; |
| 112 | list<Predicate> Predicates = [IsARM]; |
| 113 | } |
| 114 | |
Evan Cheng | c5409a8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 115 | // Special cases |
| 116 | class XI<bits<4> opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz, |
| 117 | IndexMode im, Format f, string asm, string cstr, list<dag> pattern> |
| 118 | : InstARM<opcod, am, sz, im, f, cstr> { |
| 119 | let OutOperandList = oops; |
| 120 | let InOperandList = iops; |
| 121 | let AsmString = asm; |
| 122 | let Pattern = pattern; |
| 123 | list<Predicate> Predicates = [IsARM]; |
| 124 | } |
| 125 | |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 126 | class AI<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 127 | string asm, list<dag> pattern> |
| 128 | : I<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc, |
| 129 | asm,"",pattern>; |
| 130 | class AsI<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 131 | string asm, list<dag> pattern> |
| 132 | : sI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc, |
| 133 | asm,"",pattern>; |
Evan Cheng | c5409a8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 134 | class AXI<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 135 | list<dag> pattern> |
| 136 | : XI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm, |
| 137 | "", pattern>; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 138 | |
| 139 | // Ctrl flow instructions |
| 140 | class ABLpredI<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 141 | string asm, list<dag> pattern> |
| 142 | : I<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc, |
| 143 | asm,"",pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 144 | let Inst{27-24} = opcod; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 145 | } |
| 146 | class ABLI<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 147 | list<dag> pattern> |
| 148 | : XI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm, |
| 149 | "", pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 150 | let Inst{27-24} = opcod; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 151 | } |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 152 | // FIXME: BX |
Evan Cheng | c5409a8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 153 | class AXIx2<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 154 | list<dag> pattern> |
| 155 | : XI<opcod, oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, f, asm, |
| 156 | "", pattern>; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 157 | class ABI<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 158 | list<dag> pattern> |
| 159 | : XI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm, |
| 160 | "", pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 161 | let Inst{27-24} = opcod; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 162 | } |
| 163 | class ABccI<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 164 | string asm, list<dag> pattern> |
| 165 | : I<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc, |
| 166 | asm,"",pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 167 | let Inst{27-24} = opcod; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | // BR_JT instructions |
| 171 | // == mov pc |
| 172 | class JTI<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern> |
| 173 | : XI<opcod, oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BranchMisc, |
| 174 | asm, "", pattern> { |
| 175 | let Inst{20} = 0; // S Bit |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 176 | let Inst{24-21} = opcod; |
| 177 | let Inst{27-26} = {0,0}; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 178 | } |
Evan Cheng | 18e5d10 | 2008-09-17 07:16:21 +0000 | [diff] [blame] | 179 | // == add pc |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 180 | class JTI1<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern> |
| 181 | : XI<opcod, oops, iops, AddrMode1, SizeSpecial, IndexModeNone, BranchMisc, |
| 182 | asm, "", pattern> { |
Evan Cheng | 18e5d10 | 2008-09-17 07:16:21 +0000 | [diff] [blame] | 183 | let Inst{20} = 0; // S bit |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 184 | let Inst{24-21} = opcod; |
| 185 | let Inst{27-26} = {0,0}; |
Evan Cheng | 18e5d10 | 2008-09-17 07:16:21 +0000 | [diff] [blame] | 186 | } |
| 187 | // == ldr pc |
| 188 | class JTI2<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern> |
| 189 | : XI<opcod, oops, iops, AddrMode2, SizeSpecial, IndexModeNone, BranchMisc, |
| 190 | asm, "", pattern> { |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 191 | let Inst{20} = 1; // L bit |
| 192 | let Inst{21} = 0; // W bit |
| 193 | let Inst{22} = 0; // B bit |
| 194 | let Inst{24} = 1; // P bit |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 195 | let Inst{27-26} = {0,1}; |
Evan Cheng | 10a9eb8 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 196 | } |
| 197 | |
Evan Cheng | 2e62b66 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 198 | |
| 199 | // addrmode1 instructions |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 200 | class AI1<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 201 | string asm, list<dag> pattern> |
| 202 | : I<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | d075035 | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 203 | asm, "", pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 204 | let Inst{24-21} = opcod; |
| 205 | let Inst{27-26} = {0,0}; |
Evan Cheng | d075035 | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 206 | } |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 207 | class AsI1<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 208 | string asm, list<dag> pattern> |
| 209 | : sI<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | d075035 | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 210 | asm, "", pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 211 | let Inst{24-21} = opcod; |
| 212 | let Inst{27-26} = {0,0}; |
Evan Cheng | d075035 | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 213 | } |
Evan Cheng | c5409a8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 214 | class AXI1<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 215 | list<dag> pattern> |
| 216 | : XI<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, asm, |
| 217 | "", pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 218 | let Inst{24-21} = opcod; |
| 219 | let Inst{27-26} = {0,0}; |
Evan Cheng | c5409a8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 220 | } |
Evan Cheng | 2e62b66 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 221 | class AI1x2<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 222 | string asm, list<dag> pattern> |
| 223 | : I<opcod, oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, opc, |
| 224 | asm, "", pattern>; |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 225 | |
Evan Cheng | 2e62b66 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 226 | |
| 227 | // addrmode2 loads and stores |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 228 | class AI2<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 229 | string asm, list<dag> pattern> |
| 230 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 231 | asm, "", pattern> { |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 232 | let Inst{27-26} = {0,1}; |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 233 | } |
Evan Cheng | c5409a8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 234 | class AXI2<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 235 | list<dag> pattern> |
| 236 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 237 | "", pattern>; |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 238 | |
| 239 | // loads |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 240 | class AI2ldw<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 241 | string asm, list<dag> pattern> |
| 242 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 243 | let Inst{20} = 1; // L bit |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 244 | let Inst{21} = 0; // W bit |
| 245 | let Inst{22} = 0; // B bit |
| 246 | let Inst{24} = 1; // P bit |
| 247 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 248 | class AXI2ldw<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 249 | list<dag> pattern> |
| 250 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 251 | "", pattern> { |
| 252 | let Inst{20} = 1; // L bit |
| 253 | let Inst{21} = 0; // W bit |
| 254 | let Inst{22} = 0; // B bit |
| 255 | let Inst{24} = 1; // P bit |
| 256 | } |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 257 | class AI2ldb<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 258 | string asm, list<dag> pattern> |
| 259 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 260 | let Inst{20} = 1; // L bit |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 261 | let Inst{21} = 0; // W bit |
| 262 | let Inst{22} = 1; // B bit |
| 263 | let Inst{24} = 1; // P bit |
| 264 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 265 | class AXI2ldb<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 266 | list<dag> pattern> |
| 267 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 268 | "", pattern> { |
| 269 | let Inst{20} = 1; // L bit |
| 270 | let Inst{21} = 0; // W bit |
| 271 | let Inst{22} = 1; // B bit |
| 272 | let Inst{24} = 1; // P bit |
| 273 | } |
Evan Cheng | da02002 | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 274 | |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 275 | // stores |
| 276 | class AI2stw<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 277 | string asm, list<dag> pattern> |
| 278 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 279 | let Inst{20} = 0; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 280 | let Inst{21} = 0; // W bit |
| 281 | let Inst{22} = 0; // B bit |
| 282 | let Inst{24} = 1; // P bit |
| 283 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 284 | class AXI2stw<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 285 | list<dag> pattern> |
| 286 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 287 | "", pattern> { |
| 288 | let Inst{20} = 0; // L bit |
| 289 | let Inst{21} = 0; // W bit |
| 290 | let Inst{22} = 0; // B bit |
| 291 | let Inst{24} = 1; // P bit |
| 292 | } |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 293 | class AI2stb<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 294 | string asm, list<dag> pattern> |
| 295 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 296 | let Inst{20} = 0; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 297 | let Inst{21} = 0; // W bit |
| 298 | let Inst{22} = 1; // B bit |
| 299 | let Inst{24} = 1; // P bit |
| 300 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 301 | class AXI2stb<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 302 | list<dag> pattern> |
| 303 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 304 | "", pattern> { |
| 305 | let Inst{20} = 0; // L bit |
| 306 | let Inst{21} = 0; // W bit |
| 307 | let Inst{22} = 1; // B bit |
| 308 | let Inst{24} = 1; // P bit |
| 309 | } |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 310 | |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 311 | // Pre-indexed loads |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 312 | class AI2ldwpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 313 | string asm, string cstr, list<dag> pattern> |
| 314 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc, |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 315 | asm, cstr, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 316 | let Inst{20} = 1; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 317 | let Inst{21} = 1; // W bit |
| 318 | let Inst{22} = 0; // B bit |
| 319 | let Inst{24} = 1; // P bit |
| 320 | } |
| 321 | class AI2ldbpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 322 | string asm, string cstr, list<dag> pattern> |
| 323 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc, |
| 324 | asm, cstr, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 325 | let Inst{20} = 1; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 326 | let Inst{21} = 1; // W bit |
| 327 | let Inst{22} = 1; // B bit |
| 328 | let Inst{24} = 1; // P bit |
| 329 | } |
| 330 | |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 331 | // Pre-indexed stores |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 332 | class AI2stwpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 333 | string asm, string cstr, list<dag> pattern> |
| 334 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc, |
| 335 | asm, cstr, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 336 | let Inst{20} = 0; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 337 | let Inst{21} = 1; // W bit |
| 338 | let Inst{22} = 0; // B bit |
| 339 | let Inst{24} = 1; // P bit |
| 340 | } |
| 341 | class AI2stbpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 342 | string asm, string cstr, list<dag> pattern> |
| 343 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc, |
| 344 | asm, cstr, pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 345 | let Inst{20} = 0; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 346 | let Inst{21} = 1; // W bit |
| 347 | let Inst{22} = 1; // B bit |
| 348 | let Inst{24} = 1; // P bit |
| 349 | } |
| 350 | |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 351 | // Post-indexed loads |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 352 | class AI2ldwpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 353 | string asm, string cstr, list<dag> pattern> |
| 354 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc, |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 355 | asm, cstr,pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 356 | let Inst{20} = 1; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 357 | let Inst{21} = 0; // W bit |
| 358 | let Inst{22} = 0; // B bit |
| 359 | let Inst{24} = 0; // P bit |
| 360 | } |
| 361 | class AI2ldbpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 362 | string asm, string cstr, list<dag> pattern> |
| 363 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc, |
| 364 | asm, cstr,pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 365 | let Inst{20} = 1; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 366 | let Inst{21} = 0; // W bit |
| 367 | let Inst{22} = 1; // B bit |
| 368 | let Inst{24} = 0; // P bit |
| 369 | } |
| 370 | |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 371 | // Post-indexed stores |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 372 | class AI2stwpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 373 | string asm, string cstr, list<dag> pattern> |
| 374 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc, |
| 375 | asm, cstr,pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 376 | let Inst{20} = 0; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 377 | let Inst{21} = 0; // W bit |
| 378 | let Inst{22} = 0; // B bit |
| 379 | let Inst{24} = 0; // P bit |
| 380 | } |
| 381 | class AI2stbpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 382 | string asm, string cstr, list<dag> pattern> |
| 383 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc, |
| 384 | asm, cstr,pattern> { |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 385 | let Inst{20} = 0; // L bit |
Evan Cheng | 1a7c1cc | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 386 | let Inst{21} = 0; // W bit |
| 387 | let Inst{22} = 1; // B bit |
| 388 | let Inst{24} = 0; // P bit |
| 389 | } |
| 390 | |
Evan Cheng | 2e62b66 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 391 | // addrmode3 instructions |
| 392 | class AI3<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 393 | string asm, list<dag> pattern> |
| 394 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 395 | asm, "", pattern>; |
Evan Cheng | c5409a8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 396 | class AXI3<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 397 | list<dag> pattern> |
| 398 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 399 | "", pattern>; |
Evan Cheng | 2e62b66 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 400 | |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 401 | // loads |
| 402 | class AI3ldh<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 403 | string asm, list<dag> pattern> |
| 404 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 405 | asm, "", pattern> { |
| 406 | let Inst{4} = 1; |
| 407 | let Inst{5} = 1; // H bit |
| 408 | let Inst{6} = 0; // S bit |
| 409 | let Inst{7} = 1; |
| 410 | let Inst{20} = 1; // L bit |
| 411 | let Inst{21} = 0; // W bit |
| 412 | let Inst{24} = 1; // P bit |
| 413 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 414 | class AXI3ldh<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 415 | list<dag> pattern> |
| 416 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 417 | "", pattern> { |
| 418 | let Inst{4} = 1; |
| 419 | let Inst{5} = 1; // H bit |
| 420 | let Inst{6} = 0; // S bit |
| 421 | let Inst{7} = 1; |
| 422 | let Inst{20} = 1; // L bit |
| 423 | let Inst{21} = 0; // W bit |
| 424 | let Inst{24} = 1; // P bit |
| 425 | } |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 426 | class AI3ldsh<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 427 | string asm, list<dag> pattern> |
| 428 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 429 | asm, "", pattern> { |
| 430 | let Inst{4} = 1; |
| 431 | let Inst{5} = 1; // H bit |
| 432 | let Inst{6} = 1; // S bit |
| 433 | let Inst{7} = 1; |
| 434 | let Inst{20} = 1; // L bit |
| 435 | let Inst{21} = 0; // W bit |
| 436 | let Inst{24} = 1; // P bit |
| 437 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 438 | class AXI3ldsh<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 439 | list<dag> pattern> |
| 440 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 441 | "", pattern> { |
| 442 | let Inst{4} = 1; |
| 443 | let Inst{5} = 1; // H bit |
| 444 | let Inst{6} = 1; // S bit |
| 445 | let Inst{7} = 1; |
| 446 | let Inst{20} = 1; // L bit |
| 447 | let Inst{21} = 0; // W bit |
| 448 | let Inst{24} = 1; // P bit |
| 449 | } |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 450 | class AI3ldsb<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 451 | string asm, list<dag> pattern> |
| 452 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 453 | asm, "", pattern> { |
| 454 | let Inst{4} = 1; |
| 455 | let Inst{5} = 0; // H bit |
| 456 | let Inst{6} = 1; // S bit |
| 457 | let Inst{7} = 1; |
| 458 | let Inst{20} = 1; // L bit |
| 459 | let Inst{21} = 0; // W bit |
| 460 | let Inst{24} = 1; // P bit |
| 461 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 462 | class AXI3ldsb<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 463 | list<dag> pattern> |
| 464 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 465 | "", pattern> { |
| 466 | let Inst{4} = 1; |
| 467 | let Inst{5} = 0; // H bit |
| 468 | let Inst{6} = 1; // S bit |
| 469 | let Inst{7} = 1; |
| 470 | let Inst{20} = 1; // L bit |
| 471 | let Inst{21} = 0; // W bit |
| 472 | let Inst{24} = 1; // P bit |
| 473 | } |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 474 | class AI3ldd<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 475 | string asm, list<dag> pattern> |
| 476 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 477 | asm, "", pattern> { |
| 478 | let Inst{4} = 1; |
| 479 | let Inst{5} = 0; // H bit |
| 480 | let Inst{6} = 1; // S bit |
| 481 | let Inst{7} = 1; |
| 482 | let Inst{20} = 0; // L bit |
| 483 | let Inst{21} = 0; // W bit |
| 484 | let Inst{24} = 1; // P bit |
| 485 | } |
| 486 | |
| 487 | // stores |
| 488 | class AI3sth<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 489 | string asm, list<dag> pattern> |
| 490 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 491 | asm, "", pattern> { |
| 492 | let Inst{4} = 1; |
| 493 | let Inst{5} = 1; // H bit |
| 494 | let Inst{6} = 0; // S bit |
| 495 | let Inst{7} = 1; |
| 496 | let Inst{20} = 0; // L bit |
| 497 | let Inst{21} = 0; // W bit |
| 498 | let Inst{24} = 1; // P bit |
| 499 | } |
Evan Cheng | ae7b1d7 | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 500 | class AXI3sth<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 501 | list<dag> pattern> |
| 502 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 503 | "", pattern> { |
| 504 | let Inst{4} = 1; |
| 505 | let Inst{5} = 1; // H bit |
| 506 | let Inst{6} = 0; // S bit |
| 507 | let Inst{7} = 1; |
| 508 | let Inst{20} = 0; // L bit |
| 509 | let Inst{21} = 0; // W bit |
| 510 | let Inst{24} = 1; // P bit |
| 511 | } |
Evan Cheng | ac92c3f | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 512 | class AI3std<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 513 | string asm, list<dag> pattern> |
| 514 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 515 | asm, "", pattern> { |
| 516 | let Inst{4} = 1; |
| 517 | let Inst{5} = 1; // H bit |
| 518 | let Inst{6} = 1; // S bit |
| 519 | let Inst{7} = 1; |
| 520 | let Inst{20} = 0; // L bit |
| 521 | let Inst{21} = 0; // W bit |
| 522 | let Inst{24} = 1; // P bit |
| 523 | } |
| 524 | |
| 525 | // Pre-indexed loads |
| 526 | class AI3ldhpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 527 | string asm, string cstr, list<dag> pattern> |
| 528 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 529 | asm, cstr, pattern> { |
| 530 | let Inst{4} = 1; |
| 531 | let Inst{5} = 1; // H bit |
| 532 | let Inst{6} = 0; // S bit |
| 533 | let Inst{7} = 1; |
| 534 | let Inst{20} = 1; // L bit |
| 535 | let Inst{21} = 1; // W bit |
| 536 | let Inst{24} = 1; // P bit |
| 537 | } |
| 538 | class AI3ldshpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 539 | string asm, string cstr, list<dag> pattern> |
| 540 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 541 | asm, cstr, pattern> { |
| 542 | let Inst{4} = 1; |
| 543 | let Inst{5} = 1; // H bit |
| 544 | let Inst{6} = 1; // S bit |
| 545 | let Inst{7} = 1; |
| 546 | let Inst{20} = 1; // L bit |
| 547 | let Inst{21} = 1; // W bit |
| 548 | let Inst{24} = 1; // P bit |
| 549 | } |
| 550 | class AI3ldsbpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 551 | string asm, string cstr, list<dag> pattern> |
| 552 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 553 | asm, cstr, pattern> { |
| 554 | let Inst{4} = 1; |
| 555 | let Inst{5} = 0; // H bit |
| 556 | let Inst{6} = 1; // S bit |
| 557 | let Inst{7} = 1; |
| 558 | let Inst{20} = 1; // L bit |
| 559 | let Inst{21} = 1; // W bit |
| 560 | let Inst{24} = 1; // P bit |
| 561 | } |
| 562 | |
| 563 | // Pre-indexed stores |
| 564 | class AI3sthpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 565 | string asm, string cstr, list<dag> pattern> |
| 566 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 567 | asm, cstr, pattern> { |
| 568 | let Inst{4} = 1; |
| 569 | let Inst{5} = 1; // H bit |
| 570 | let Inst{6} = 0; // S bit |
| 571 | let Inst{7} = 1; |
| 572 | let Inst{20} = 0; // L bit |
| 573 | let Inst{21} = 1; // W bit |
| 574 | let Inst{24} = 1; // P bit |
| 575 | } |
| 576 | |
| 577 | // Post-indexed loads |
| 578 | class AI3ldhpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 579 | string asm, string cstr, list<dag> pattern> |
| 580 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 581 | asm, cstr,pattern> { |
| 582 | let Inst{4} = 1; |
| 583 | let Inst{5} = 1; // H bit |
| 584 | let Inst{6} = 0; // S bit |
| 585 | let Inst{7} = 1; |
| 586 | let Inst{20} = 1; // L bit |
| 587 | let Inst{21} = 1; // W bit |
| 588 | let Inst{24} = 0; // P bit |
| 589 | } |
| 590 | class AI3ldshpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 591 | string asm, string cstr, list<dag> pattern> |
| 592 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 593 | asm, cstr,pattern> { |
| 594 | let Inst{4} = 1; |
| 595 | let Inst{5} = 1; // H bit |
| 596 | let Inst{6} = 1; // S bit |
| 597 | let Inst{7} = 1; |
| 598 | let Inst{20} = 1; // L bit |
| 599 | let Inst{21} = 1; // W bit |
| 600 | let Inst{24} = 0; // P bit |
| 601 | } |
| 602 | class AI3ldsbpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 603 | string asm, string cstr, list<dag> pattern> |
| 604 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 605 | asm, cstr,pattern> { |
| 606 | let Inst{4} = 1; |
| 607 | let Inst{5} = 0; // H bit |
| 608 | let Inst{6} = 1; // S bit |
| 609 | let Inst{7} = 1; |
| 610 | let Inst{20} = 1; // L bit |
| 611 | let Inst{21} = 1; // W bit |
| 612 | let Inst{24} = 0; // P bit |
| 613 | } |
| 614 | |
| 615 | // Post-indexed stores |
| 616 | class AI3sthpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 617 | string asm, string cstr, list<dag> pattern> |
| 618 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 619 | asm, cstr,pattern> { |
| 620 | let Inst{4} = 1; |
| 621 | let Inst{5} = 1; // H bit |
| 622 | let Inst{6} = 0; // S bit |
| 623 | let Inst{7} = 1; |
| 624 | let Inst{20} = 0; // L bit |
| 625 | let Inst{21} = 1; // W bit |
| 626 | let Inst{24} = 0; // P bit |
| 627 | } |
| 628 | |
| 629 | |
Evan Cheng | 2e62b66 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 630 | // addrmode4 instructions |
| 631 | class AI4<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 632 | string asm, list<dag> pattern> |
| 633 | : I<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | d36b01c | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 634 | asm, "", pattern> { |
Evan Cheng | 18e5d10 | 2008-09-17 07:16:21 +0000 | [diff] [blame] | 635 | let Inst{25-27} = {0,0,1}; |
Evan Cheng | d36b01c | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 636 | } |
| 637 | class AXI4ld<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 638 | list<dag> pattern> |
| 639 | : XI<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm, |
Evan Cheng | d36b01c | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 640 | "", pattern> { |
| 641 | let Inst{20} = 1; // L bit |
| 642 | let Inst{22} = 0; // S bit |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 643 | let Inst{27-25} = 0b100; |
Evan Cheng | d36b01c | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 644 | } |
| 645 | class AXI4ldpc<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 646 | list<dag> pattern> |
| 647 | : XI<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm, |
| 648 | "", pattern> { |
| 649 | let Inst{20} = 1; // L bit |
| 650 | let Inst{22} = 1; // S bit |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 651 | let Inst{27-25} = 0b100; |
Evan Cheng | d36b01c | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 652 | } |
| 653 | class AXI4st<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 654 | list<dag> pattern> |
| 655 | : XI<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm, |
| 656 | "", pattern> { |
| 657 | let Inst{20} = 0; // L bit |
| 658 | let Inst{22} = 0; // S bit |
Jim Grosbach | 88c246f | 2008-10-14 20:36:24 +0000 | [diff] [blame] | 659 | let Inst{27-25} = 0b100; |
Evan Cheng | d36b01c | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 660 | } |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 661 | |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 662 | |
Evan Cheng | 7b0249b | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 663 | //===----------------------------------------------------------------------===// |
| 664 | |
| 665 | // ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode. |
| 666 | class ARMPat<dag pattern, dag result> : Pat<pattern, result> { |
| 667 | list<Predicate> Predicates = [IsARM]; |
| 668 | } |
| 669 | class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> { |
| 670 | list<Predicate> Predicates = [IsARM, HasV5TE]; |
| 671 | } |
| 672 | class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> { |
| 673 | list<Predicate> Predicates = [IsARM, HasV6]; |
| 674 | } |
Evan Cheng | 34a46e1 | 2008-08-29 06:41:12 +0000 | [diff] [blame] | 675 | |
| 676 | //===----------------------------------------------------------------------===// |
| 677 | // |
| 678 | // Thumb Instruction Format Definitions. |
| 679 | // |
| 680 | |
| 681 | |
| 682 | // TI - Thumb instruction. |
| 683 | |
| 684 | class ThumbI<dag outs, dag ins, AddrMode am, SizeFlagVal sz, |
| 685 | string asm, string cstr, list<dag> pattern> |
| 686 | // FIXME: Set all opcodes to 0 for now. |
| 687 | : InstARM<0, am, sz, IndexModeNone, ThumbFrm, cstr> { |
| 688 | let OutOperandList = outs; |
| 689 | let InOperandList = ins; |
| 690 | let AsmString = asm; |
| 691 | let Pattern = pattern; |
| 692 | list<Predicate> Predicates = [IsThumb]; |
| 693 | } |
| 694 | |
| 695 | class TI<dag outs, dag ins, string asm, list<dag> pattern> |
| 696 | : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>; |
| 697 | class TI1<dag outs, dag ins, string asm, list<dag> pattern> |
| 698 | : ThumbI<outs, ins, AddrModeT1, Size2Bytes, asm, "", pattern>; |
| 699 | class TI2<dag outs, dag ins, string asm, list<dag> pattern> |
| 700 | : ThumbI<outs, ins, AddrModeT2, Size2Bytes, asm, "", pattern>; |
| 701 | class TI4<dag outs, dag ins, string asm, list<dag> pattern> |
| 702 | : ThumbI<outs, ins, AddrModeT4, Size2Bytes, asm, "", pattern>; |
| 703 | class TIs<dag outs, dag ins, string asm, list<dag> pattern> |
| 704 | : ThumbI<outs, ins, AddrModeTs, Size2Bytes, asm, "", pattern>; |
| 705 | |
| 706 | // Two-address instructions |
| 707 | class TIt<dag outs, dag ins, string asm, list<dag> pattern> |
| 708 | : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>; |
| 709 | |
| 710 | // BL, BLX(1) are translated by assembler into two instructions |
| 711 | class TIx2<dag outs, dag ins, string asm, list<dag> pattern> |
| 712 | : ThumbI<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>; |
| 713 | |
| 714 | // BR_JT instructions |
| 715 | class TJTI<dag outs, dag ins, string asm, list<dag> pattern> |
| 716 | : ThumbI<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>; |
| 717 | |
| 718 | |
| 719 | //===----------------------------------------------------------------------===// |
| 720 | |
| 721 | |
| 722 | // ThumbPat - Same as Pat<>, but requires that the compiler be in Thumb mode. |
| 723 | class ThumbPat<dag pattern, dag result> : Pat<pattern, result> { |
| 724 | list<Predicate> Predicates = [IsThumb]; |
| 725 | } |
| 726 | |
| 727 | class ThumbV5Pat<dag pattern, dag result> : Pat<pattern, result> { |
| 728 | list<Predicate> Predicates = [IsThumb, HasV5T]; |
| 729 | } |