Misha Brukman | ffe9968 | 2005-02-05 02:24:26 +0000 | [diff] [blame^] | 1 | //===- AlphaInstrFormats.td - Alpha Instruction Formats ----*- tablegen -*-===// |
Andrew Lenharth | a1b5ca2 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 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 | //3.3: |
| 14 | //Memory |
| 15 | //Branch |
| 16 | //Operate |
| 17 | //Floating-point |
| 18 | //PALcode |
| 19 | |
| 20 | //===----------------------------------------------------------------------===// |
| 21 | // Instruction format superclass |
| 22 | //===----------------------------------------------------------------------===// |
| 23 | |
| 24 | class InstAlpha<bits<6> op, dag OL, string asmstr> : Instruction { // Alpha instruction baseline |
| 25 | field bits<32> Inst; |
Andrew Lenharth | a1b5ca2 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 26 | let Namespace = "Alpha"; |
| 27 | let OperandList = OL; |
| 28 | let AsmString = asmstr; |
| 29 | |
| 30 | |
| 31 | let Inst{31-26} = op; |
| 32 | } |
| 33 | |
| 34 | //3.3.1 |
| 35 | class MForm<bits<6> opcode, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> { |
| 36 | bits<5> Ra; |
| 37 | bits<5> Rb; |
| 38 | bits<16> disp; |
| 39 | |
| 40 | let Inst{25-21} = Ra; |
| 41 | let Inst{20-16} = Rb; |
| 42 | let Inst{15-0} = disp; |
| 43 | } |
| 44 | |
| 45 | //3.3.2 |
| 46 | let isBranch = 1, isTerminator = 1 in |
| 47 | class BForm<bits<6> opcode, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> { |
| 48 | bits<5> Ra; |
| 49 | bits<21> disp; |
| 50 | |
| 51 | let Inst{25-21} = Ra; |
| 52 | let Inst{20-0} = disp; |
| 53 | } |
| 54 | |
| 55 | //3.3.3 |
| 56 | class OForm<bits<6> opcode, bits<7> fun, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> { |
| 57 | bits<5> Ra; |
| 58 | bits<5> Rb; |
| 59 | bits<3> SBZ; |
| 60 | bits<7> Function = fun; |
| 61 | bits<5> Rc; |
| 62 | |
| 63 | let Inst{25-21} = Ra; |
| 64 | let Inst{20-16} = Rb; |
| 65 | let Inst{15-13} = SBZ; |
| 66 | let Inst{12} = 0; |
| 67 | let Inst{11-5} = Function; |
| 68 | let Inst{4-0} = Rc; |
| 69 | } |
| 70 | |
| 71 | |
Andrew Lenharth | 2f0f845 | 2005-01-24 19:44:07 +0000 | [diff] [blame] | 72 | class OFormL<bits<6> opcode, bits<7> fun, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> { |
Andrew Lenharth | a1b5ca2 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 73 | bits<5> Ra; |
| 74 | bits<8> LIT; |
Andrew Lenharth | 2f0f845 | 2005-01-24 19:44:07 +0000 | [diff] [blame] | 75 | bits<7> Function = fun; |
Andrew Lenharth | a1b5ca2 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 76 | bits<5> Rc; |
| 77 | |
| 78 | let Inst{25-21} = Ra; |
| 79 | let Inst{20-13} = LIT; |
| 80 | let Inst{12} = 1; |
| 81 | let Inst{11-5} = Function; |
| 82 | let Inst{4-0} = Rc; |
| 83 | } |
| 84 | |
| 85 | //3.3.4 |
Andrew Lenharth | 5ae5f81 | 2005-01-26 21:54:09 +0000 | [diff] [blame] | 86 | class FPForm<bits<6> opcode, bits<11> fun, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> { |
Andrew Lenharth | a1b5ca2 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 87 | bits<5> Fa; |
| 88 | bits<5> Fb; |
Andrew Lenharth | 5ae5f81 | 2005-01-26 21:54:09 +0000 | [diff] [blame] | 89 | bits<11> Function = fun; |
Andrew Lenharth | a1b5ca2 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 90 | bits<5> Fc; |
| 91 | |
| 92 | let Inst{25-21} = Fa; |
| 93 | let Inst{20-16} = Fb; |
| 94 | let Inst{15-5} = Function; |
| 95 | let Inst{4-0} = Fc; |
| 96 | } |
| 97 | |
| 98 | //3.3.5 |
| 99 | class PALForm<bits<6> opcode, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> { |
| 100 | bits<26> Function; |
| 101 | |
| 102 | let Inst{25-0} = Function; |
| 103 | } |
| 104 | |
| 105 | |
| 106 | // Pseudo instructions. |
| 107 | class PseudoInstAlpha<dag OL, string nm> : InstAlpha<0, OL, nm> { |
| 108 | } |