Evan Cheng | 37f25d9 | 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 | 05fc966 | 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 | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 44 | |
Evan Cheng | 05fc966 | 2008-09-13 01:35:33 +0000 | [diff] [blame] | 45 | def LdFrm : Format<22>; |
| 46 | def StFrm : Format<23>; |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 47 | |
Evan Cheng | 05fc966 | 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 | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 51 | |
| 52 | |
Evan Cheng | 37f25d9 | 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 | 612b79e | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 61 | field bits<32> Inst; |
| 62 | |
Evan Cheng | 37f25d9 | 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 | 4bbd5f8 | 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 | 37f25d9 | 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 | 4bbd5f8 | 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 | 3aac788 | 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> { |
| 144 | let Inst{24} = 1; // L bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 145 | let Inst{25-27} = {1,0,1}; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 146 | } |
| 147 | class ABLI<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 148 | list<dag> pattern> |
| 149 | : XI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm, |
| 150 | "", pattern> { |
| 151 | let Inst{24} = 1; // L bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 152 | let Inst{25-27} = {1,0,1}; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 153 | } |
| 154 | class ABLXI<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 155 | list<dag> pattern> |
| 156 | : XI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm, |
| 157 | "", pattern> { |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 158 | let Inst{4-7} = {1,1,0,0}; |
| 159 | let Inst{20-27} = {0,1,0,0,1,0,0,0}; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 160 | } |
| 161 | // FIXME: BX |
Evan Cheng | 4bbd5f8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 162 | class AXIx2<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 163 | list<dag> pattern> |
| 164 | : XI<opcod, oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, f, asm, |
| 165 | "", pattern>; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 166 | class ABI<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 167 | list<dag> pattern> |
| 168 | : XI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm, |
| 169 | "", pattern> { |
| 170 | let Inst{24} = 0; // L bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 171 | let Inst{25-27} = {1,0,1}; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 172 | } |
| 173 | class ABccI<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 174 | string asm, list<dag> pattern> |
| 175 | : I<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc, |
| 176 | asm,"",pattern> { |
| 177 | let Inst{24} = 0; // L bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 178 | let Inst{25-27} = {1,0,1}; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | // BR_JT instructions |
| 182 | // == mov pc |
| 183 | class JTI<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern> |
| 184 | : XI<opcod, oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BranchMisc, |
| 185 | asm, "", pattern> { |
| 186 | let Inst{20} = 0; // S Bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 187 | let Inst{21-24} = {1,0,1,1}; |
| 188 | let Inst{26-27} = {0,0}; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 189 | } |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 190 | // == add pc |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 191 | class JTI1<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern> |
| 192 | : XI<opcod, oops, iops, AddrMode1, SizeSpecial, IndexModeNone, BranchMisc, |
| 193 | asm, "", pattern> { |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 194 | let Inst{20} = 0; // S bit |
| 195 | let Inst{21-24} = {0,0,1,0}; |
| 196 | let Inst{26-27} = {0,0}; |
| 197 | } |
| 198 | // == ldr pc |
| 199 | class JTI2<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern> |
| 200 | : XI<opcod, oops, iops, AddrMode2, SizeSpecial, IndexModeNone, BranchMisc, |
| 201 | asm, "", pattern> { |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 202 | let Inst{20} = 1; // L bit |
| 203 | let Inst{21} = 0; // W bit |
| 204 | let Inst{22} = 0; // B bit |
| 205 | let Inst{24} = 1; // P bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 206 | let Inst{26-27} = {0,0}; |
Evan Cheng | 3aac788 | 2008-09-01 08:25:56 +0000 | [diff] [blame] | 207 | } |
| 208 | |
Evan Cheng | 0d14fc8 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 209 | |
| 210 | // addrmode1 instructions |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 211 | class AI1<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 212 | string asm, list<dag> pattern> |
| 213 | : I<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | 612b79e | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 214 | asm, "", pattern> { |
Evan Cheng | b7880ac | 2008-08-31 18:32:16 +0000 | [diff] [blame] | 215 | let Inst{21-24} = opcod; |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 216 | let Inst{26-27} = {0,0}; |
Evan Cheng | 612b79e | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 217 | } |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 218 | class AsI1<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 219 | string asm, list<dag> pattern> |
| 220 | : sI<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | 612b79e | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 221 | asm, "", pattern> { |
Evan Cheng | b7880ac | 2008-08-31 18:32:16 +0000 | [diff] [blame] | 222 | let Inst{21-24} = opcod; |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 223 | let Inst{26-27} = {0,0}; |
Evan Cheng | 612b79e | 2008-08-29 07:40:52 +0000 | [diff] [blame] | 224 | } |
Evan Cheng | 4bbd5f8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 225 | class AXI1<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 226 | list<dag> pattern> |
| 227 | : XI<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, asm, |
| 228 | "", pattern> { |
Evan Cheng | 4bbd5f8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 229 | let Inst{21-24} = opcod; |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 230 | let Inst{26-27} = {0,0}; |
Evan Cheng | 4bbd5f8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 231 | } |
Evan Cheng | 0d14fc8 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 232 | class AI1x2<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 233 | string asm, list<dag> pattern> |
| 234 | : I<opcod, oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, opc, |
| 235 | asm, "", pattern>; |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 236 | |
Evan Cheng | 0d14fc8 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 237 | |
| 238 | // addrmode2 loads and stores |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 239 | class AI2<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 240 | string asm, list<dag> pattern> |
| 241 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 242 | asm, "", pattern> { |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 243 | let Inst{26-27} = {1,0}; |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 244 | } |
Evan Cheng | 4bbd5f8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 245 | class AXI2<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 246 | list<dag> pattern> |
| 247 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 248 | "", pattern>; |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 249 | |
| 250 | // loads |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 251 | class AI2ldw<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 252 | string asm, list<dag> pattern> |
| 253 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 254 | let Inst{20} = 1; // L bit |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 255 | let Inst{21} = 0; // W bit |
| 256 | let Inst{22} = 0; // B bit |
| 257 | let Inst{24} = 1; // P bit |
| 258 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 259 | class AXI2ldw<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 260 | list<dag> pattern> |
| 261 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 262 | "", pattern> { |
| 263 | let Inst{20} = 1; // L bit |
| 264 | let Inst{21} = 0; // W bit |
| 265 | let Inst{22} = 0; // B bit |
| 266 | let Inst{24} = 1; // P bit |
| 267 | } |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 268 | class AI2ldb<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 269 | string asm, list<dag> pattern> |
| 270 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 271 | let Inst{20} = 1; // L bit |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 272 | let Inst{21} = 0; // W bit |
| 273 | let Inst{22} = 1; // B bit |
| 274 | let Inst{24} = 1; // P bit |
| 275 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 276 | class AXI2ldb<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 277 | list<dag> pattern> |
| 278 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 279 | "", pattern> { |
| 280 | let Inst{20} = 1; // L bit |
| 281 | let Inst{21} = 0; // W bit |
| 282 | let Inst{22} = 1; // B bit |
| 283 | let Inst{24} = 1; // P bit |
| 284 | } |
Evan Cheng | 17222df | 2008-08-31 19:02:21 +0000 | [diff] [blame] | 285 | |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 286 | // stores |
| 287 | class AI2stw<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 288 | string asm, list<dag> pattern> |
| 289 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 290 | let Inst{20} = 0; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 291 | let Inst{21} = 0; // W bit |
| 292 | let Inst{22} = 0; // B bit |
| 293 | let Inst{24} = 1; // P bit |
| 294 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 295 | class AXI2stw<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 296 | list<dag> pattern> |
| 297 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 298 | "", pattern> { |
| 299 | let Inst{20} = 0; // L bit |
| 300 | let Inst{21} = 0; // W bit |
| 301 | let Inst{22} = 0; // B bit |
| 302 | let Inst{24} = 1; // P bit |
| 303 | } |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 304 | class AI2stb<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 305 | string asm, list<dag> pattern> |
| 306 | : AI2<opcod, oops, iops, f, opc, asm, pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 307 | let Inst{20} = 0; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 308 | let Inst{21} = 0; // W bit |
| 309 | let Inst{22} = 1; // B bit |
| 310 | let Inst{24} = 1; // P bit |
| 311 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 312 | class AXI2stb<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 313 | list<dag> pattern> |
| 314 | : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm, |
| 315 | "", pattern> { |
| 316 | let Inst{20} = 0; // L bit |
| 317 | let Inst{21} = 0; // W bit |
| 318 | let Inst{22} = 1; // B bit |
| 319 | let Inst{24} = 1; // P bit |
| 320 | } |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 321 | |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 322 | // Pre-indexed loads |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 323 | class AI2ldwpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 324 | string asm, string cstr, list<dag> pattern> |
| 325 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc, |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 326 | asm, cstr, pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 327 | let Inst{20} = 1; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 328 | let Inst{21} = 1; // W bit |
| 329 | let Inst{22} = 0; // B bit |
| 330 | let Inst{24} = 1; // P bit |
| 331 | } |
| 332 | class AI2ldbpr<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 | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 336 | let Inst{20} = 1; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 337 | let Inst{21} = 1; // W bit |
| 338 | let Inst{22} = 1; // B bit |
| 339 | let Inst{24} = 1; // P bit |
| 340 | } |
| 341 | |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 342 | // Pre-indexed stores |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 343 | class AI2stwpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 344 | string asm, string cstr, list<dag> pattern> |
| 345 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc, |
| 346 | asm, cstr, pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 347 | let Inst{20} = 0; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 348 | let Inst{21} = 1; // W bit |
| 349 | let Inst{22} = 0; // B bit |
| 350 | let Inst{24} = 1; // P bit |
| 351 | } |
| 352 | class AI2stbpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 353 | string asm, string cstr, list<dag> pattern> |
| 354 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc, |
| 355 | asm, cstr, pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 356 | let Inst{20} = 0; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 357 | let Inst{21} = 1; // W bit |
| 358 | let Inst{22} = 1; // B bit |
| 359 | let Inst{24} = 1; // P bit |
| 360 | } |
| 361 | |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 362 | // Post-indexed loads |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 363 | class AI2ldwpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 364 | string asm, string cstr, list<dag> pattern> |
| 365 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc, |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 366 | asm, cstr,pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 367 | let Inst{20} = 1; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 368 | let Inst{21} = 0; // W bit |
| 369 | let Inst{22} = 0; // B bit |
| 370 | let Inst{24} = 0; // P bit |
| 371 | } |
| 372 | class AI2ldbpo<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 | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 376 | let Inst{20} = 1; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 377 | let Inst{21} = 0; // W bit |
| 378 | let Inst{22} = 1; // B bit |
| 379 | let Inst{24} = 0; // P bit |
| 380 | } |
| 381 | |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 382 | // Post-indexed stores |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 383 | class AI2stwpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 384 | string asm, string cstr, list<dag> pattern> |
| 385 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc, |
| 386 | asm, cstr,pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 387 | let Inst{20} = 0; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 388 | let Inst{21} = 0; // W bit |
| 389 | let Inst{22} = 0; // B bit |
| 390 | let Inst{24} = 0; // P bit |
| 391 | } |
| 392 | class AI2stbpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 393 | string asm, string cstr, list<dag> pattern> |
| 394 | : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc, |
| 395 | asm, cstr,pattern> { |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 396 | let Inst{20} = 0; // L bit |
Evan Cheng | 9391273 | 2008-09-01 01:27:33 +0000 | [diff] [blame] | 397 | let Inst{21} = 0; // W bit |
| 398 | let Inst{22} = 1; // B bit |
| 399 | let Inst{24} = 0; // P bit |
| 400 | } |
| 401 | |
Evan Cheng | 0d14fc8 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 402 | // addrmode3 instructions |
| 403 | class AI3<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 404 | string asm, list<dag> pattern> |
| 405 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 406 | asm, "", pattern>; |
Evan Cheng | 4bbd5f8 | 2008-09-01 07:19:00 +0000 | [diff] [blame] | 407 | class AXI3<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 408 | list<dag> pattern> |
| 409 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 410 | "", pattern>; |
Evan Cheng | 0d14fc8 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 411 | |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 412 | // loads |
| 413 | class AI3ldh<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 414 | string asm, list<dag> pattern> |
| 415 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 416 | asm, "", pattern> { |
| 417 | let Inst{4} = 1; |
| 418 | let Inst{5} = 1; // H bit |
| 419 | let Inst{6} = 0; // S bit |
| 420 | let Inst{7} = 1; |
| 421 | let Inst{20} = 1; // L bit |
| 422 | let Inst{21} = 0; // W bit |
| 423 | let Inst{24} = 1; // P bit |
| 424 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 425 | class AXI3ldh<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 426 | list<dag> pattern> |
| 427 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 428 | "", pattern> { |
| 429 | let Inst{4} = 1; |
| 430 | let Inst{5} = 1; // H bit |
| 431 | let Inst{6} = 0; // S bit |
| 432 | let Inst{7} = 1; |
| 433 | let Inst{20} = 1; // L bit |
| 434 | let Inst{21} = 0; // W bit |
| 435 | let Inst{24} = 1; // P bit |
| 436 | } |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 437 | class AI3ldsh<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 438 | string asm, list<dag> pattern> |
| 439 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 440 | asm, "", pattern> { |
| 441 | let Inst{4} = 1; |
| 442 | let Inst{5} = 1; // H bit |
| 443 | let Inst{6} = 1; // S bit |
| 444 | let Inst{7} = 1; |
| 445 | let Inst{20} = 1; // L bit |
| 446 | let Inst{21} = 0; // W bit |
| 447 | let Inst{24} = 1; // P bit |
| 448 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 449 | class AXI3ldsh<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 450 | list<dag> pattern> |
| 451 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 452 | "", pattern> { |
| 453 | let Inst{4} = 1; |
| 454 | let Inst{5} = 1; // H bit |
| 455 | let Inst{6} = 1; // S bit |
| 456 | let Inst{7} = 1; |
| 457 | let Inst{20} = 1; // L bit |
| 458 | let Inst{21} = 0; // W bit |
| 459 | let Inst{24} = 1; // P bit |
| 460 | } |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 461 | class AI3ldsb<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 462 | string asm, list<dag> pattern> |
| 463 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 464 | asm, "", pattern> { |
| 465 | let Inst{4} = 1; |
| 466 | let Inst{5} = 0; // H bit |
| 467 | let Inst{6} = 1; // S bit |
| 468 | let Inst{7} = 1; |
| 469 | let Inst{20} = 1; // L bit |
| 470 | let Inst{21} = 0; // W bit |
| 471 | let Inst{24} = 1; // P bit |
| 472 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 473 | class AXI3ldsb<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 474 | list<dag> pattern> |
| 475 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 476 | "", pattern> { |
| 477 | let Inst{4} = 1; |
| 478 | let Inst{5} = 0; // H bit |
| 479 | let Inst{6} = 1; // S bit |
| 480 | let Inst{7} = 1; |
| 481 | let Inst{20} = 1; // L bit |
| 482 | let Inst{21} = 0; // W bit |
| 483 | let Inst{24} = 1; // P bit |
| 484 | } |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 485 | class AI3ldd<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 486 | string asm, list<dag> pattern> |
| 487 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 488 | asm, "", pattern> { |
| 489 | let Inst{4} = 1; |
| 490 | let Inst{5} = 0; // H bit |
| 491 | let Inst{6} = 1; // S bit |
| 492 | let Inst{7} = 1; |
| 493 | let Inst{20} = 0; // L bit |
| 494 | let Inst{21} = 0; // W bit |
| 495 | let Inst{24} = 1; // P bit |
| 496 | } |
| 497 | |
| 498 | // stores |
| 499 | class AI3sth<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 500 | string asm, list<dag> pattern> |
| 501 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 502 | asm, "", pattern> { |
| 503 | let Inst{4} = 1; |
| 504 | let Inst{5} = 1; // H bit |
| 505 | let Inst{6} = 0; // S bit |
| 506 | let Inst{7} = 1; |
| 507 | let Inst{20} = 0; // L bit |
| 508 | let Inst{21} = 0; // W bit |
| 509 | let Inst{24} = 1; // P bit |
| 510 | } |
Evan Cheng | 5d2c1cf | 2008-09-01 07:34:13 +0000 | [diff] [blame] | 511 | class AXI3sth<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 512 | list<dag> pattern> |
| 513 | : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm, |
| 514 | "", pattern> { |
| 515 | let Inst{4} = 1; |
| 516 | let Inst{5} = 1; // H bit |
| 517 | let Inst{6} = 0; // S bit |
| 518 | let Inst{7} = 1; |
| 519 | let Inst{20} = 0; // L bit |
| 520 | let Inst{21} = 0; // W bit |
| 521 | let Inst{24} = 1; // P bit |
| 522 | } |
Evan Cheng | 840917b | 2008-09-01 07:00:14 +0000 | [diff] [blame] | 523 | class AI3std<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 524 | string asm, list<dag> pattern> |
| 525 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc, |
| 526 | asm, "", pattern> { |
| 527 | let Inst{4} = 1; |
| 528 | let Inst{5} = 1; // H bit |
| 529 | let Inst{6} = 1; // S bit |
| 530 | let Inst{7} = 1; |
| 531 | let Inst{20} = 0; // L bit |
| 532 | let Inst{21} = 0; // W bit |
| 533 | let Inst{24} = 1; // P bit |
| 534 | } |
| 535 | |
| 536 | // Pre-indexed loads |
| 537 | class AI3ldhpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 538 | string asm, string cstr, list<dag> pattern> |
| 539 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 540 | asm, cstr, pattern> { |
| 541 | let Inst{4} = 1; |
| 542 | let Inst{5} = 1; // H bit |
| 543 | let Inst{6} = 0; // S bit |
| 544 | let Inst{7} = 1; |
| 545 | let Inst{20} = 1; // L bit |
| 546 | let Inst{21} = 1; // W bit |
| 547 | let Inst{24} = 1; // P bit |
| 548 | } |
| 549 | class AI3ldshpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 550 | string asm, string cstr, list<dag> pattern> |
| 551 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 552 | asm, cstr, pattern> { |
| 553 | let Inst{4} = 1; |
| 554 | let Inst{5} = 1; // H bit |
| 555 | let Inst{6} = 1; // S bit |
| 556 | let Inst{7} = 1; |
| 557 | let Inst{20} = 1; // L bit |
| 558 | let Inst{21} = 1; // W bit |
| 559 | let Inst{24} = 1; // P bit |
| 560 | } |
| 561 | class AI3ldsbpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 562 | string asm, string cstr, list<dag> pattern> |
| 563 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 564 | asm, cstr, pattern> { |
| 565 | let Inst{4} = 1; |
| 566 | let Inst{5} = 0; // H bit |
| 567 | let Inst{6} = 1; // S bit |
| 568 | let Inst{7} = 1; |
| 569 | let Inst{20} = 1; // L bit |
| 570 | let Inst{21} = 1; // W bit |
| 571 | let Inst{24} = 1; // P bit |
| 572 | } |
| 573 | |
| 574 | // Pre-indexed stores |
| 575 | class AI3sthpr<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 576 | string asm, string cstr, list<dag> pattern> |
| 577 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc, |
| 578 | asm, cstr, pattern> { |
| 579 | let Inst{4} = 1; |
| 580 | let Inst{5} = 1; // H bit |
| 581 | let Inst{6} = 0; // S bit |
| 582 | let Inst{7} = 1; |
| 583 | let Inst{20} = 0; // L bit |
| 584 | let Inst{21} = 1; // W bit |
| 585 | let Inst{24} = 1; // P bit |
| 586 | } |
| 587 | |
| 588 | // Post-indexed loads |
| 589 | class AI3ldhpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 590 | string asm, string cstr, list<dag> pattern> |
| 591 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 592 | asm, cstr,pattern> { |
| 593 | let Inst{4} = 1; |
| 594 | let Inst{5} = 1; // H bit |
| 595 | let Inst{6} = 0; // S bit |
| 596 | let Inst{7} = 1; |
| 597 | let Inst{20} = 1; // L bit |
| 598 | let Inst{21} = 1; // W bit |
| 599 | let Inst{24} = 0; // P bit |
| 600 | } |
| 601 | class AI3ldshpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 602 | string asm, string cstr, list<dag> pattern> |
| 603 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 604 | asm, cstr,pattern> { |
| 605 | let Inst{4} = 1; |
| 606 | let Inst{5} = 1; // H bit |
| 607 | let Inst{6} = 1; // S bit |
| 608 | let Inst{7} = 1; |
| 609 | let Inst{20} = 1; // L bit |
| 610 | let Inst{21} = 1; // W bit |
| 611 | let Inst{24} = 0; // P bit |
| 612 | } |
| 613 | class AI3ldsbpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 614 | string asm, string cstr, list<dag> pattern> |
| 615 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 616 | asm, cstr,pattern> { |
| 617 | let Inst{4} = 1; |
| 618 | let Inst{5} = 0; // H bit |
| 619 | let Inst{6} = 1; // S bit |
| 620 | let Inst{7} = 1; |
| 621 | let Inst{20} = 1; // L bit |
| 622 | let Inst{21} = 1; // W bit |
| 623 | let Inst{24} = 0; // P bit |
| 624 | } |
| 625 | |
| 626 | // Post-indexed stores |
| 627 | class AI3sthpo<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 628 | string asm, string cstr, list<dag> pattern> |
| 629 | : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc, |
| 630 | asm, cstr,pattern> { |
| 631 | let Inst{4} = 1; |
| 632 | let Inst{5} = 1; // H bit |
| 633 | let Inst{6} = 0; // S bit |
| 634 | let Inst{7} = 1; |
| 635 | let Inst{20} = 0; // L bit |
| 636 | let Inst{21} = 1; // W bit |
| 637 | let Inst{24} = 0; // P bit |
| 638 | } |
| 639 | |
| 640 | |
Evan Cheng | 0d14fc8 | 2008-09-01 01:51:14 +0000 | [diff] [blame] | 641 | // addrmode4 instructions |
| 642 | class AI4<bits<4> opcod, dag oops, dag iops, Format f, string opc, |
| 643 | string asm, list<dag> pattern> |
| 644 | : I<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, opc, |
Evan Cheng | 3c2ee49 | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 645 | asm, "", pattern> { |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 646 | let Inst{25-27} = {0,0,1}; |
Evan Cheng | 3c2ee49 | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 647 | } |
| 648 | class AXI4ld<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 649 | list<dag> pattern> |
| 650 | : XI<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm, |
Evan Cheng | 3c2ee49 | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 651 | "", pattern> { |
| 652 | let Inst{20} = 1; // L bit |
| 653 | let Inst{22} = 0; // S bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 654 | let Inst{25-27} = {0,0,1}; |
Evan Cheng | 3c2ee49 | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 655 | } |
| 656 | class AXI4ldpc<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 657 | list<dag> pattern> |
| 658 | : XI<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm, |
| 659 | "", pattern> { |
| 660 | let Inst{20} = 1; // L bit |
| 661 | let Inst{22} = 1; // S bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 662 | let Inst{25-27} = {0,0,1}; |
Evan Cheng | 3c2ee49 | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 663 | } |
| 664 | class AXI4st<bits<4> opcod, dag oops, dag iops, Format f, string asm, |
| 665 | list<dag> pattern> |
| 666 | : XI<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm, |
| 667 | "", pattern> { |
| 668 | let Inst{20} = 0; // L bit |
| 669 | let Inst{22} = 0; // S bit |
Evan Cheng | 29c57c3 | 2008-09-17 07:16:21 +0000 | [diff] [blame^] | 670 | let Inst{25-27} = {0,0,1}; |
Evan Cheng | 3c2ee49 | 2008-09-01 07:48:18 +0000 | [diff] [blame] | 671 | } |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 672 | |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 673 | |
Evan Cheng | 37f25d9 | 2008-08-28 23:39:26 +0000 | [diff] [blame] | 674 | //===----------------------------------------------------------------------===// |
| 675 | |
| 676 | // ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode. |
| 677 | class ARMPat<dag pattern, dag result> : Pat<pattern, result> { |
| 678 | list<Predicate> Predicates = [IsARM]; |
| 679 | } |
| 680 | class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> { |
| 681 | list<Predicate> Predicates = [IsARM, HasV5TE]; |
| 682 | } |
| 683 | class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> { |
| 684 | list<Predicate> Predicates = [IsARM, HasV6]; |
| 685 | } |
Evan Cheng | 1309664 | 2008-08-29 06:41:12 +0000 | [diff] [blame] | 686 | |
| 687 | //===----------------------------------------------------------------------===// |
| 688 | // |
| 689 | // Thumb Instruction Format Definitions. |
| 690 | // |
| 691 | |
| 692 | |
| 693 | // TI - Thumb instruction. |
| 694 | |
| 695 | class ThumbI<dag outs, dag ins, AddrMode am, SizeFlagVal sz, |
| 696 | string asm, string cstr, list<dag> pattern> |
| 697 | // FIXME: Set all opcodes to 0 for now. |
| 698 | : InstARM<0, am, sz, IndexModeNone, ThumbFrm, cstr> { |
| 699 | let OutOperandList = outs; |
| 700 | let InOperandList = ins; |
| 701 | let AsmString = asm; |
| 702 | let Pattern = pattern; |
| 703 | list<Predicate> Predicates = [IsThumb]; |
| 704 | } |
| 705 | |
| 706 | class TI<dag outs, dag ins, string asm, list<dag> pattern> |
| 707 | : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>; |
| 708 | class TI1<dag outs, dag ins, string asm, list<dag> pattern> |
| 709 | : ThumbI<outs, ins, AddrModeT1, Size2Bytes, asm, "", pattern>; |
| 710 | class TI2<dag outs, dag ins, string asm, list<dag> pattern> |
| 711 | : ThumbI<outs, ins, AddrModeT2, Size2Bytes, asm, "", pattern>; |
| 712 | class TI4<dag outs, dag ins, string asm, list<dag> pattern> |
| 713 | : ThumbI<outs, ins, AddrModeT4, Size2Bytes, asm, "", pattern>; |
| 714 | class TIs<dag outs, dag ins, string asm, list<dag> pattern> |
| 715 | : ThumbI<outs, ins, AddrModeTs, Size2Bytes, asm, "", pattern>; |
| 716 | |
| 717 | // Two-address instructions |
| 718 | class TIt<dag outs, dag ins, string asm, list<dag> pattern> |
| 719 | : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>; |
| 720 | |
| 721 | // BL, BLX(1) are translated by assembler into two instructions |
| 722 | class TIx2<dag outs, dag ins, string asm, list<dag> pattern> |
| 723 | : ThumbI<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>; |
| 724 | |
| 725 | // BR_JT instructions |
| 726 | class TJTI<dag outs, dag ins, string asm, list<dag> pattern> |
| 727 | : ThumbI<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>; |
| 728 | |
| 729 | |
| 730 | //===----------------------------------------------------------------------===// |
| 731 | |
| 732 | |
| 733 | // ThumbPat - Same as Pat<>, but requires that the compiler be in Thumb mode. |
| 734 | class ThumbPat<dag pattern, dag result> : Pat<pattern, result> { |
| 735 | list<Predicate> Predicates = [IsThumb]; |
| 736 | } |
| 737 | |
| 738 | class ThumbV5Pat<dag pattern, dag result> : Pat<pattern, result> { |
| 739 | list<Predicate> Predicates = [IsThumb, HasV5T]; |
| 740 | } |