1 //===- AlphaInstrFormats.td - Alpha Instruction Formats ----*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
20 def u8imm : Operand<i64>;
21 def s14imm : Operand<i64>;
22 def s16imm : Operand<i64>;
23 def s21imm : Operand<i64>;
24 def s64imm : Operand<i64>;
26 //===----------------------------------------------------------------------===//
27 // Instruction format superclass
28 //===----------------------------------------------------------------------===//
29 // Alpha instruction baseline
30 class InstAlphaAlt<bits<6> op, string asmstr> : Instruction {
32 let Namespace = "Alpha";
33 let AsmString = asmstr;
37 class InstAlpha<bits<6> op, dag OL, string asmstr>
38 : InstAlphaAlt<op, asmstr> { // Alpha instruction baseline
43 class MForm<bits<6> opcode, bit store, bit load, string asmstr, list<dag> pattern>
44 : InstAlphaAlt<opcode, asmstr> {
45 let Pattern = pattern;
55 let Inst{15-0} = disp;
57 class MFormAlt<bits<6> opcode, string asmstr>
58 : InstAlphaAlt<opcode, asmstr> {
65 let Inst{15-0} = disp;
67 class MfcForm<bits<6> opcode, bits<16> fc, string asmstr>
68 : InstAlpha<opcode, (ops GPRC:$RA, GPRC:$RB), asmstr> {
77 class MbrForm<bits<6> opcode, bits<2> TB, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> {
85 let Inst{13-0} = disp;
89 let isBranch = 1, isTerminator = 1 in
90 class BForm<bits<6> opcode, string asmstr>
91 : InstAlpha<opcode, (ops GPRC:$RA, s21imm:$DISP), asmstr> {
96 let Inst{20-0} = disp;
98 def target : Operand<OtherVT> {}
99 let isBranch = 1, isTerminator = 1 in
100 class BFormD<bits<6> opcode, string asmstr, list<dag> pattern>
101 : InstAlpha<opcode, (ops target:$DISP), asmstr> {
102 let Pattern = pattern;
107 let Inst{25-21} = Ra;
108 let Inst{20-0} = disp;
110 let isBranch = 1, isTerminator = 1 in
111 class BFormDG<bits<6> opcode, string asmstr, list<dag> pattern>
112 : InstAlpha<opcode, (ops GPRC:$RA, target:$DISP), asmstr> {
113 let Pattern = pattern;
118 let Inst{25-21} = Ra;
119 let Inst{20-0} = disp;
122 let isBranch = 1, isTerminator = 1 in
123 class FBForm<bits<6> opcode, string asmstr, list<dag> pattern>
124 : InstAlpha<opcode, (ops F8RC:$RA, target:$DISP), asmstr> {
125 let Pattern = pattern;
130 let Inst{25-21} = Ra;
131 let Inst{20-0} = disp;
135 class OForm<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
136 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RA, GPRC:$RB), asmstr> {
137 let Pattern = pattern;
142 bits<7> Function = fun;
144 let Inst{25-21} = Ra;
145 let Inst{20-16} = Rb;
148 let Inst{11-5} = Function;
152 class OForm2<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
153 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RB), asmstr> {
154 let Pattern = pattern;
158 bits<7> Function = fun;
160 let Inst{25-21} = 31;
161 let Inst{20-16} = Rb;
164 let Inst{11-5} = Function;
168 class OForm4<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
169 : InstAlphaAlt<opcode, asmstr> {
170 let Pattern = pattern;
175 bits<7> Function = fun;
177 let isTwoAddress = 1;
178 let Inst{25-21} = Ra;
179 let Inst{20-16} = Rb;
182 let Inst{11-5} = Function;
187 class OFormL<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
188 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RA, u8imm:$L), asmstr> {
189 let Pattern = pattern;
194 bits<7> Function = fun;
196 let Inst{25-21} = Ra;
197 let Inst{20-13} = LIT;
199 let Inst{11-5} = Function;
203 class OForm4L<bits<6> opcode, bits<7> fun, string asmstr>
204 : InstAlpha<opcode, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), asmstr> {
208 bits<7> Function = fun;
210 let isTwoAddress = 1;
211 let Inst{25-21} = Ra;
212 let Inst{20-13} = LIT;
214 let Inst{11-5} = Function;
219 class FPForm<bits<6> opcode, bits<11> fun, string asmstr, list<dag> pattern>
220 : InstAlphaAlt<opcode, asmstr> {
221 let Pattern = pattern;
226 bits<11> Function = fun;
228 let Inst{25-21} = Fa;
229 let Inst{20-16} = Fb;
230 let Inst{15-5} = Function;
235 class PALForm<bits<6> opcode, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> {
238 let Inst{25-0} = Function;
242 // Pseudo instructions.
243 class PseudoInstAlpha<dag OL, string nm, list<dag> pattern> : InstAlpha<0, OL, nm> {
244 let Pattern = pattern;