Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 1 | //===- PowerPCInstrFormats.td - PowerPC Instruction Formats --*- tablegen -*-=// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | class Format<bits<5> val> { |
| 14 | bits<5> Value = val; |
| 15 | } |
| 16 | |
| 17 | def Pseudo: Format<0>; |
| 18 | def Gpr : Format<1>; |
| 19 | def Gpr0 : Format<2>; |
| 20 | def Simm16 : Format<3>; |
| 21 | def Zimm16 : Format<4>; |
| 22 | def PCRelimm24 : Format<5>; |
| 23 | def Imm24 : Format<6>; |
| 24 | def Imm5 : Format<7>; |
| 25 | def PCRelimm14 : Format<8>; |
| 26 | def Imm14 : Format<9>; |
| 27 | def Imm2 : Format<10>; |
| 28 | def Crf : Format<11>; |
| 29 | def Imm3 : Format<12>; |
| 30 | def Imm1 : Format<13>; |
| 31 | def Fpr : Format<14>; |
| 32 | def Imm4 : Format<15>; |
| 33 | def Imm8 : Format<16>; |
| 34 | def Disimm16 : Format<17>; |
| 35 | def Disimm14 : Format<18>; |
| 36 | def Spr : Format<19>; |
| 37 | def Sgr : Format<20>; |
| 38 | def Imm15 : Format<21>; |
| 39 | def Vpr : Format<22>; |
| 40 | |
| 41 | class PPC32Inst : Instruction { |
| 42 | field bits<32> Inst; |
| 43 | bits<3> ArgCount; |
| 44 | bits<5> Arg0Type; |
| 45 | bits<5> Arg1Type; |
| 46 | bits<5> Arg2Type; |
| 47 | bits<5> Arg3Type; |
| 48 | bits<5> Arg4Type; |
| 49 | bit PPC64; |
| 50 | bit VMX; |
| 51 | |
| 52 | let Namespace = "PPC32"; |
| 53 | } |
| 54 | |
Misha Brukman | 6b21bde | 2004-08-02 21:56:35 +0000 | [diff] [blame] | 55 | //===----------------------------------------------------------------------===// |
| 56 | // |
| 57 | // PowerPC instruction formats |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 58 | |
Misha Brukman | 6b21bde | 2004-08-02 21:56:35 +0000 | [diff] [blame] | 59 | class PPC32I<string name, bits<6> opcode, bit ppc64, bit vmx> : Instruction { |
| 60 | field bits<32> Inst; |
| 61 | field bits<6> Opcode = opcode; |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 62 | |
Misha Brukman | 6b21bde | 2004-08-02 21:56:35 +0000 | [diff] [blame] | 63 | bits<3> ArgCount; |
| 64 | bits<5> Arg0Type; |
| 65 | bits<5> Arg1Type; |
| 66 | bits<5> Arg2Type; |
| 67 | bits<5> Arg3Type; |
| 68 | bits<5> Arg4Type; |
| 69 | bit PPC64 = ppc64; |
| 70 | bit VMX = vmx; |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 71 | |
Misha Brukman | 6b21bde | 2004-08-02 21:56:35 +0000 | [diff] [blame] | 72 | let Name = name; |
| 73 | let Inst{0-5} = Opcode; |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 74 | } |
| 75 | |
Misha Brukman | 6b21bde | 2004-08-02 21:56:35 +0000 | [diff] [blame] | 76 | class XForm_base_r3xo<string name, bits<6> opcode, bits<10> xo, bit ppc64, |
| 77 | bit vmx> : PPC32I<name, opcode, ppc64, vmx> { |
| 78 | let ArgCount = 3; |
| 79 | field bits<5> A; |
| 80 | field bits<5> B; |
| 81 | field bits<5> C; |
| 82 | field bits<10> D = xo; |
| 83 | field bit Rc = 0; |
| 84 | |
| 85 | let ArgCount = 3; |
| 86 | let Arg0Type = Gpr.Value; |
| 87 | let Arg1Type = Gpr.Value; |
| 88 | let Arg2Type = Gpr.Value; |
| 89 | let Arg3Type = 0; |
| 90 | let Arg4Type = 0; |
| 91 | |
| 92 | let Inst{6-10} = A; |
| 93 | let Inst{11-15} = B; |
| 94 | let Inst{16-20} = C; |
| 95 | let Inst{21-30} = D; |
| 96 | let Inst{31} = Rc; |
| 97 | } |
| 98 | |
| 99 | class XForm_6<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64, |
| 100 | bit vmx> : XForm_base_r3xo<name, opcode, xo, ppc64, vmx> { |
| 101 | let Rc = rc; |
| 102 | } |
| 103 | |
| 104 | class XForm_7<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx> |
| 105 | : XForm_6<name, opcode, xo, 1, ppc64, vmx>; |
| 106 | |
| 107 | class XForm_10<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64, |
| 108 | bit vmx> : XForm_base_r3xo<name, opcode, xo, ppc64, vmx> { |
| 109 | let Rc = rc; |
| 110 | let Arg2Type = Imm5.Value; |
| 111 | } |
| 112 | |
| 113 | class DForm_base<string name, bits<6> opcode, bit ppc64, bit vmx> |
| 114 | : PPC32I<name, opcode, ppc64, vmx> { |
| 115 | field bits<5> A; |
| 116 | field bits<5> B; |
| 117 | field bits<16> C; |
| 118 | |
| 119 | let ArgCount = 3; |
| 120 | let Arg0Type = Gpr.Value; |
| 121 | let Arg1Type = Gpr.Value; |
| 122 | let Arg2Type = Simm16.Value; |
| 123 | let Arg3Type = 0; |
| 124 | let Arg4Type = 0; |
| 125 | |
| 126 | let Inst{6-10} = A; |
| 127 | let Inst{11-15} = B; |
| 128 | let Inst{16-31} = C; |
| 129 | } |
| 130 | |
| 131 | class DForm_1<string name, bits<6> opcode, bit ppc64, bit vmx> |
| 132 | : DForm_base<name, opcode, ppc64, vmx> { |
| 133 | let Arg2Type = Zimm16.Value; |
| 134 | } |
| 135 | |
| 136 | class DForm_2<string name, bits<6> opcode, bit ppc64, bit vmx> |
| 137 | : DForm_base<name, opcode, ppc64, vmx>; |
| 138 | |
| 139 | class DForm_2_r0<string name, bits<6> opcode, bit ppc64, bit vmx> |
| 140 | : DForm_base<name, opcode, ppc64, vmx> { |
| 141 | let Arg1Type = Gpr0.Value; |
| 142 | } |
| 143 | |
| 144 | // Currently we make the use/def reg distinction in ISel, not tablegen |
| 145 | class DForm_3<string name, bits<6> opcode, bit ppc64, bit vmx> |
| 146 | : DForm_1<name, opcode, ppc64, vmx>; |
| 147 | |
| 148 | class DForm_4<string name, bits<6> opcode, bit ppc64, bit vmx> |
| 149 | : DForm_1<name, opcode, ppc64, vmx>; |
| 150 | |
| 151 | class DForm_7<string name, bits<6> opcode, bit ppc64, bit vmx> |
| 152 | : DForm_base<name, opcode, ppc64, vmx> { |
| 153 | let Arg1Type = Imm5.Value; |
| 154 | } |
| 155 | |
| 156 | //===----------------------------------------------------------------------===// |
| 157 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 158 | class PPC32InstPattern1 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<5> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 159 | let Name = name; |
| 160 | let ArgCount = 2; |
| 161 | let PPC64 = ppc64; |
| 162 | let VMX =vmx; |
| 163 | |
| 164 | let Arg0Type = OperandType0.Value; |
| 165 | let Arg1Type = OperandType1.Value; |
| 166 | let Arg2Type = 0; |
| 167 | let Arg3Type = 0; |
| 168 | let Arg4Type = 0; |
| 169 | let PPC64 = 0; |
| 170 | let VMX = 0; |
| 171 | bits<5> operand0; |
| 172 | bits<16> operand1; |
| 173 | |
| 174 | |
| 175 | let Inst {31-26} = opconstant0; |
| 176 | let Inst {20-16} = opconstant1; |
| 177 | let Inst {25-21} = operand0; |
| 178 | let Inst {15-0} = operand1; |
| 179 | } |
| 180 | |
| 181 | class PPC32InstPattern2 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 182 | let Name = name; |
| 183 | let ArgCount = 3; |
| 184 | let PPC64 = ppc64; |
| 185 | let VMX =vmx; |
| 186 | |
| 187 | let Arg0Type = OperandType0.Value; |
| 188 | let Arg1Type = OperandType1.Value; |
| 189 | let Arg2Type = OperandType2.Value; |
| 190 | let Arg3Type = 0; |
| 191 | let Arg4Type = 0; |
| 192 | let PPC64 = 0; |
| 193 | let VMX = 0; |
| 194 | bits<5> operand0; |
| 195 | bits<5> operand1; |
| 196 | bits<5> operand2; |
| 197 | |
| 198 | |
| 199 | let Inst {31-26} = opconstant0; |
| 200 | let Inst {10-0} = opconstant1; |
| 201 | let Inst {25-21} = operand0; |
| 202 | let Inst {20-16} = operand1; |
| 203 | let Inst {15-11} = operand2; |
| 204 | } |
| 205 | |
| 206 | class PPC32InstPattern3 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<16> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 207 | let Name = name; |
| 208 | let ArgCount = 2; |
| 209 | let PPC64 = ppc64; |
| 210 | let VMX =vmx; |
| 211 | |
| 212 | let Arg0Type = OperandType0.Value; |
| 213 | let Arg1Type = OperandType1.Value; |
| 214 | let Arg2Type = 0; |
| 215 | let Arg3Type = 0; |
| 216 | let Arg4Type = 0; |
| 217 | let PPC64 = 0; |
| 218 | let VMX = 0; |
| 219 | bits<5> operand0; |
| 220 | bits<5> operand1; |
| 221 | |
| 222 | |
| 223 | let Inst {31-26} = opconstant0; |
| 224 | let Inst {15-0} = opconstant1; |
| 225 | let Inst {25-21} = operand0; |
| 226 | let Inst {20-16} = operand1; |
| 227 | } |
| 228 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 229 | class PPC32InstPattern6 <string name, Format OperandType0, bits<6> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 230 | let Name = name; |
| 231 | let ArgCount = 1; |
| 232 | let PPC64 = ppc64; |
| 233 | let VMX =vmx; |
| 234 | |
| 235 | let Arg0Type = OperandType0.Value; |
| 236 | let Arg1Type = 0; |
| 237 | let Arg2Type = 0; |
| 238 | let Arg3Type = 0; |
| 239 | let Arg4Type = 0; |
| 240 | let PPC64 = 0; |
| 241 | let VMX = 0; |
| 242 | bits<24> operand0; |
| 243 | |
| 244 | |
| 245 | let Inst {31-26} = opconstant0; |
| 246 | let Inst {1-0} = opconstant1; |
| 247 | let Inst {25-2} = operand0; |
| 248 | } |
| 249 | |
| 250 | class PPC32InstPattern7 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 251 | let Name = name; |
| 252 | let ArgCount = 3; |
| 253 | let PPC64 = ppc64; |
| 254 | let VMX =vmx; |
| 255 | |
| 256 | let Arg0Type = OperandType0.Value; |
| 257 | let Arg1Type = OperandType1.Value; |
| 258 | let Arg2Type = OperandType2.Value; |
| 259 | let Arg3Type = 0; |
| 260 | let Arg4Type = 0; |
| 261 | let PPC64 = 0; |
| 262 | let VMX = 0; |
| 263 | bits<5> operand0; |
| 264 | bits<5> operand1; |
| 265 | bits<14> operand2; |
| 266 | |
| 267 | |
| 268 | let Inst {31-26} = opconstant0; |
| 269 | let Inst {1-0} = opconstant1; |
| 270 | let Inst {25-21} = operand0; |
| 271 | let Inst {20-16} = operand1; |
| 272 | let Inst {15-2} = operand2; |
| 273 | } |
| 274 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 275 | class PPC32InstPattern9 <string name, Format OperandType0, Format OperandType1, bits<11> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 276 | let Name = name; |
| 277 | let ArgCount = 2; |
| 278 | let PPC64 = ppc64; |
| 279 | let VMX =vmx; |
| 280 | |
| 281 | let Arg0Type = OperandType0.Value; |
| 282 | let Arg1Type = OperandType1.Value; |
| 283 | let Arg2Type = 0; |
| 284 | let Arg3Type = 0; |
| 285 | let Arg4Type = 0; |
| 286 | let PPC64 = 0; |
| 287 | let VMX = 0; |
| 288 | bits<5> operand0; |
| 289 | bits<14> operand1; |
| 290 | |
| 291 | |
| 292 | let Inst {31-21} = opconstant0; |
| 293 | let Inst {1-0} = opconstant1; |
| 294 | let Inst {20-16} = operand0; |
| 295 | let Inst {15-2} = operand1; |
| 296 | } |
| 297 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 298 | class PPC32InstPattern11 <string name, Format OperandType0, bits<19> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 299 | let Name = name; |
| 300 | let ArgCount = 1; |
| 301 | let PPC64 = ppc64; |
| 302 | let VMX =vmx; |
| 303 | |
| 304 | let Arg0Type = OperandType0.Value; |
| 305 | let Arg1Type = 0; |
| 306 | let Arg2Type = 0; |
| 307 | let Arg3Type = 0; |
| 308 | let Arg4Type = 0; |
| 309 | let PPC64 = 0; |
| 310 | let VMX = 0; |
| 311 | bits<2> operand0; |
| 312 | |
| 313 | |
| 314 | let Inst {31-13} = opconstant0; |
| 315 | let Inst {10-0} = opconstant1; |
| 316 | let Inst {12-11} = operand0; |
| 317 | } |
| 318 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 319 | class PPC32InstPattern13 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<1> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 320 | let Name = name; |
| 321 | let ArgCount = 4; |
| 322 | let PPC64 = ppc64; |
| 323 | let VMX =vmx; |
| 324 | |
| 325 | let Arg0Type = OperandType0.Value; |
| 326 | let Arg1Type = OperandType1.Value; |
| 327 | let Arg2Type = OperandType2.Value; |
| 328 | let Arg3Type = OperandType3.Value; |
| 329 | let Arg4Type = 0; |
| 330 | let PPC64 = 0; |
| 331 | let VMX = 0; |
| 332 | bits<3> operand0; |
| 333 | bits<1> operand1; |
| 334 | bits<5> operand2; |
| 335 | bits<16> operand3; |
| 336 | |
| 337 | |
| 338 | let Inst {31-26} = opconstant0; |
| 339 | let Inst {22} = opconstant1; |
| 340 | let Inst {25-23} = operand0; |
| 341 | let Inst {21} = operand1; |
| 342 | let Inst {20-16} = operand2; |
| 343 | let Inst {15-0} = operand3; |
| 344 | } |
| 345 | |
| 346 | class PPC32InstPattern14 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 347 | let Name = name; |
| 348 | let ArgCount = 3; |
| 349 | let PPC64 = ppc64; |
| 350 | let VMX =vmx; |
| 351 | |
| 352 | let Arg0Type = OperandType0.Value; |
| 353 | let Arg1Type = OperandType1.Value; |
| 354 | let Arg2Type = OperandType2.Value; |
| 355 | let Arg3Type = 0; |
| 356 | let Arg4Type = 0; |
| 357 | let PPC64 = 0; |
| 358 | let VMX = 0; |
| 359 | bits<3> operand0; |
| 360 | bits<5> operand1; |
| 361 | bits<16> operand2; |
| 362 | |
| 363 | |
| 364 | let Inst {31-26} = opconstant0; |
| 365 | let Inst {22-21} = opconstant1; |
| 366 | let Inst {25-23} = operand0; |
| 367 | let Inst {20-16} = operand1; |
| 368 | let Inst {15-0} = operand2; |
| 369 | } |
| 370 | |
| 371 | class PPC32InstPattern15 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<1> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst { |
| 372 | let Name = name; |
| 373 | let ArgCount = 4; |
| 374 | let PPC64 = ppc64; |
| 375 | let VMX =vmx; |
| 376 | |
| 377 | let Arg0Type = OperandType0.Value; |
| 378 | let Arg1Type = OperandType1.Value; |
| 379 | let Arg2Type = OperandType2.Value; |
| 380 | let Arg3Type = OperandType3.Value; |
| 381 | let Arg4Type = 0; |
| 382 | let PPC64 = 0; |
| 383 | let VMX = 0; |
| 384 | bits<3> operand0; |
| 385 | bits<1> operand1; |
| 386 | bits<5> operand2; |
| 387 | bits<5> operand3; |
| 388 | |
| 389 | |
| 390 | let Inst {31-26} = opconstant0; |
| 391 | let Inst {22} = opconstant1; |
| 392 | let Inst {10-0} = opconstant2; |
| 393 | let Inst {25-23} = operand0; |
| 394 | let Inst {21} = operand1; |
| 395 | let Inst {20-16} = operand2; |
| 396 | let Inst {15-11} = operand3; |
| 397 | } |
| 398 | |
| 399 | class PPC32InstPattern16 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<2> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst { |
| 400 | let Name = name; |
| 401 | let ArgCount = 3; |
| 402 | let PPC64 = ppc64; |
| 403 | let VMX =vmx; |
| 404 | |
| 405 | let Arg0Type = OperandType0.Value; |
| 406 | let Arg1Type = OperandType1.Value; |
| 407 | let Arg2Type = OperandType2.Value; |
| 408 | let Arg3Type = 0; |
| 409 | let Arg4Type = 0; |
| 410 | let PPC64 = 0; |
| 411 | let VMX = 0; |
| 412 | bits<3> operand0; |
| 413 | bits<5> operand1; |
| 414 | bits<5> operand2; |
| 415 | |
| 416 | |
| 417 | let Inst {31-26} = opconstant0; |
| 418 | let Inst {22-21} = opconstant1; |
| 419 | let Inst {10-0} = opconstant2; |
| 420 | let Inst {25-23} = operand0; |
| 421 | let Inst {20-16} = operand1; |
| 422 | let Inst {15-11} = operand2; |
| 423 | } |
| 424 | |
| 425 | class PPC32InstPattern17 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<16> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 426 | let Name = name; |
| 427 | let ArgCount = 2; |
| 428 | let PPC64 = ppc64; |
| 429 | let VMX =vmx; |
| 430 | |
| 431 | let Arg0Type = OperandType0.Value; |
| 432 | let Arg1Type = OperandType1.Value; |
| 433 | let Arg2Type = 0; |
| 434 | let Arg3Type = 0; |
| 435 | let Arg4Type = 0; |
| 436 | let PPC64 = 0; |
| 437 | let VMX = 0; |
| 438 | bits<5> operand0; |
| 439 | bits<5> operand1; |
| 440 | |
| 441 | |
| 442 | let Inst {31-26} = opconstant0; |
| 443 | let Inst {15-0} = opconstant1; |
| 444 | let Inst {20-16} = operand0; |
| 445 | let Inst {25-21} = operand1; |
| 446 | } |
| 447 | |
| 448 | class PPC32InstPattern18 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<5> opconstant1, bits<6> opconstant2, bit ppc64, bit vmx> : PPC32Inst { |
| 449 | let Name = name; |
| 450 | let ArgCount = 3; |
| 451 | let PPC64 = ppc64; |
| 452 | let VMX =vmx; |
| 453 | |
| 454 | let Arg0Type = OperandType0.Value; |
| 455 | let Arg1Type = OperandType1.Value; |
| 456 | let Arg2Type = OperandType2.Value; |
| 457 | let Arg3Type = 0; |
| 458 | let Arg4Type = 0; |
| 459 | let PPC64 = 0; |
| 460 | let VMX = 0; |
| 461 | bits<5> operand0; |
| 462 | bits<5> operand1; |
| 463 | bits<5> operand2; |
| 464 | |
| 465 | |
| 466 | let Inst {31-26} = opconstant0; |
| 467 | let Inst {15-11} = opconstant1; |
| 468 | let Inst {5-0} = opconstant2; |
| 469 | let Inst {25-21} = operand0; |
| 470 | let Inst {20-16} = operand1; |
| 471 | let Inst {10-6} = operand2; |
| 472 | } |
| 473 | |
| 474 | class PPC32InstPattern19 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<6> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 475 | let Name = name; |
| 476 | let ArgCount = 4; |
| 477 | let PPC64 = ppc64; |
| 478 | let VMX =vmx; |
| 479 | |
| 480 | let Arg0Type = OperandType0.Value; |
| 481 | let Arg1Type = OperandType1.Value; |
| 482 | let Arg2Type = OperandType2.Value; |
| 483 | let Arg3Type = OperandType3.Value; |
| 484 | let Arg4Type = 0; |
| 485 | let PPC64 = 0; |
| 486 | let VMX = 0; |
| 487 | bits<5> operand0; |
| 488 | bits<5> operand1; |
| 489 | bits<5> operand2; |
| 490 | bits<5> operand3; |
| 491 | |
| 492 | |
| 493 | let Inst {31-26} = opconstant0; |
| 494 | let Inst {5-0} = opconstant1; |
| 495 | let Inst {25-21} = operand0; |
| 496 | let Inst {20-16} = operand1; |
| 497 | let Inst {10-6} = operand2; |
| 498 | let Inst {15-11} = operand3; |
| 499 | } |
| 500 | |
| 501 | class PPC32InstPattern20 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<5> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst { |
| 502 | let Name = name; |
| 503 | let ArgCount = 2; |
| 504 | let PPC64 = ppc64; |
| 505 | let VMX =vmx; |
| 506 | |
| 507 | let Arg0Type = OperandType0.Value; |
| 508 | let Arg1Type = OperandType1.Value; |
| 509 | let Arg2Type = 0; |
| 510 | let Arg3Type = 0; |
| 511 | let Arg4Type = 0; |
| 512 | let PPC64 = 0; |
| 513 | let VMX = 0; |
| 514 | bits<5> operand0; |
| 515 | bits<5> operand1; |
| 516 | |
| 517 | |
| 518 | let Inst {31-26} = opconstant0; |
| 519 | let Inst {20-16} = opconstant1; |
| 520 | let Inst {10-0} = opconstant2; |
| 521 | let Inst {25-21} = operand0; |
| 522 | let Inst {15-11} = operand1; |
| 523 | } |
| 524 | |
| 525 | class PPC32InstPattern21 <string name, Format OperandType0, bits<6> opconstant0, bits<21> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 526 | let Name = name; |
| 527 | let ArgCount = 1; |
| 528 | let PPC64 = ppc64; |
| 529 | let VMX =vmx; |
| 530 | |
| 531 | let Arg0Type = OperandType0.Value; |
| 532 | let Arg1Type = 0; |
| 533 | let Arg2Type = 0; |
| 534 | let Arg3Type = 0; |
| 535 | let Arg4Type = 0; |
| 536 | let PPC64 = 0; |
| 537 | let VMX = 0; |
| 538 | bits<5> operand0; |
| 539 | |
| 540 | |
| 541 | let Inst {31-26} = opconstant0; |
| 542 | let Inst {20-0} = opconstant1; |
| 543 | let Inst {25-21} = operand0; |
| 544 | } |
| 545 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 546 | class PPC32InstPattern25 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bit ppc64, bit vmx> : PPC32Inst { |
| 547 | let Name = name; |
| 548 | let ArgCount = 3; |
| 549 | let PPC64 = ppc64; |
| 550 | let VMX =vmx; |
| 551 | |
| 552 | let Arg0Type = OperandType0.Value; |
| 553 | let Arg1Type = OperandType1.Value; |
| 554 | let Arg2Type = OperandType2.Value; |
| 555 | let Arg3Type = 0; |
| 556 | let Arg4Type = 0; |
| 557 | let PPC64 = 0; |
| 558 | let VMX = 0; |
| 559 | bits<5> operand0; |
| 560 | bits<16> operand1; |
| 561 | bits<5> operand2; |
| 562 | |
| 563 | |
| 564 | let Inst {31-26} = opconstant0; |
| 565 | let Inst {25-21} = operand0; |
| 566 | let Inst {15-0} = operand1; |
| 567 | let Inst {20-16} = operand2; |
| 568 | } |
| 569 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 570 | class PPC32InstPattern32 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<1> opconstant1, bits<12> opconstant2, bit ppc64, bit vmx> : PPC32Inst { |
| 571 | let Name = name; |
| 572 | let ArgCount = 2; |
| 573 | let PPC64 = ppc64; |
| 574 | let VMX =vmx; |
| 575 | |
| 576 | let Arg0Type = OperandType0.Value; |
| 577 | let Arg1Type = OperandType1.Value; |
| 578 | let Arg2Type = 0; |
| 579 | let Arg3Type = 0; |
| 580 | let Arg4Type = 0; |
| 581 | let PPC64 = 0; |
| 582 | let VMX = 0; |
| 583 | bits<5> operand0; |
| 584 | bits<8> operand1; |
| 585 | |
| 586 | |
| 587 | let Inst {31-26} = opconstant0; |
| 588 | let Inst {20} = opconstant1; |
| 589 | let Inst {11-0} = opconstant2; |
| 590 | let Inst {25-21} = operand0; |
| 591 | let Inst {19-12} = operand1; |
| 592 | } |
| 593 | |
| 594 | class PPC32InstPattern33 <string name, bits<32> opconstant0, bit ppc64, bit vmx> : PPC32Inst { |
| 595 | let Name = name; |
| 596 | let ArgCount = 0; |
| 597 | let PPC64 = ppc64; |
| 598 | let VMX =vmx; |
| 599 | |
| 600 | let Arg0Type = 0; |
| 601 | let Arg1Type = 0; |
| 602 | let Arg2Type = 0; |
| 603 | let Arg3Type = 0; |
| 604 | let Arg4Type = 0; |
| 605 | let PPC64 = 0; |
| 606 | let VMX = 0; |
| 607 | |
| 608 | |
| 609 | let Inst {31-0} = opconstant0; |
| 610 | } |
| 611 | |
| 612 | class PPC32InstPattern34 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, Format OperandType4, bits<6> opconstant0, bits<1> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 613 | let Name = name; |
| 614 | let ArgCount = 5; |
| 615 | let PPC64 = ppc64; |
| 616 | let VMX =vmx; |
| 617 | |
| 618 | let Arg0Type = OperandType0.Value; |
| 619 | let Arg1Type = OperandType1.Value; |
| 620 | let Arg2Type = OperandType2.Value; |
| 621 | let Arg3Type = OperandType3.Value; |
| 622 | let Arg4Type = OperandType4.Value; |
| 623 | let PPC64 = 0; |
| 624 | let VMX = 0; |
| 625 | bits<5> operand0; |
| 626 | bits<5> operand1; |
| 627 | bits<5> operand2; |
| 628 | bits<5> operand3; |
| 629 | bits<5> operand4; |
| 630 | |
| 631 | |
| 632 | let Inst {31-26} = opconstant0; |
| 633 | let Inst {0} = opconstant1; |
| 634 | let Inst {20-16} = operand0; |
| 635 | let Inst {25-21} = operand1; |
| 636 | let Inst {15-11} = operand2; |
| 637 | let Inst {10-6} = operand3; |
| 638 | let Inst {5-1} = operand4; |
| 639 | } |
| 640 | |
| 641 | class PPC32InstPattern35 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst { |
| 642 | let Name = name; |
| 643 | let ArgCount = 3; |
| 644 | let PPC64 = ppc64; |
| 645 | let VMX =vmx; |
| 646 | |
| 647 | let Arg0Type = OperandType0.Value; |
| 648 | let Arg1Type = OperandType1.Value; |
| 649 | let Arg2Type = OperandType2.Value; |
| 650 | let Arg3Type = 0; |
| 651 | let Arg4Type = 0; |
| 652 | let PPC64 = 0; |
| 653 | let VMX = 0; |
| 654 | bits<5> operand0; |
| 655 | bits<5> operand1; |
| 656 | bits<5> operand2; |
| 657 | |
| 658 | |
| 659 | let Inst {31-26} = opconstant0; |
| 660 | let Inst {10-0} = opconstant1; |
| 661 | let Inst {25-21} = operand0; |
| 662 | let Inst {15-11} = operand1; |
| 663 | let Inst {20-16} = operand2; |
| 664 | } |
| 665 | |
Misha Brukman | cd4f51b | 2004-08-02 16:54:54 +0000 | [diff] [blame] | 666 | class PPC32InstPatternPseudo <string name, Format OperandType0> : PPC32Inst { |
| 667 | let Name = name; |
| 668 | let ArgCount = 0; |
| 669 | let PPC64 = 0; |
| 670 | let VMX = 0; |
| 671 | |
| 672 | let Arg0Type = OperandType0.Value; |
| 673 | let Arg1Type = OperandType0.Value; |
| 674 | let Arg2Type = OperandType0.Value; |
| 675 | let Arg3Type = OperandType0.Value; |
| 676 | let Arg4Type = 0; |
| 677 | let PPC64 = 0; |
| 678 | let VMX = 0; |
| 679 | bits<5> operand0; |
| 680 | bits<5> operand1; |
| 681 | bits<5> operand2; |
| 682 | bits<4> operand3; |
| 683 | |
| 684 | |
| 685 | let Inst {31-0} = 0; |
| 686 | } |