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;
111 let isBranch = 1, isTerminator = 1 in
112 class FBForm<bits<6> opcode, string asmstr>
113 : InstAlpha<opcode, (ops F8RC:$RA, s21imm:$DISP), asmstr> {
117 let Inst{25-21} = Ra;
118 let Inst{20-0} = disp;
122 class OForm<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
123 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RA, GPRC:$RB), asmstr> {
124 let Pattern = pattern;
129 bits<7> Function = fun;
131 let Inst{25-21} = Ra;
132 let Inst{20-16} = Rb;
135 let Inst{11-5} = Function;
139 class OForm2<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
140 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RB), asmstr> {
141 let Pattern = pattern;
145 bits<7> Function = fun;
147 let Inst{25-21} = 31;
148 let Inst{20-16} = Rb;
151 let Inst{11-5} = Function;
155 class OForm4<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
156 : InstAlphaAlt<opcode, asmstr> {
157 let Pattern = pattern;
162 bits<7> Function = fun;
164 let isTwoAddress = 1;
165 let Inst{25-21} = Ra;
166 let Inst{20-16} = Rb;
169 let Inst{11-5} = Function;
174 class OFormL<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
175 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RA, u8imm:$L), asmstr> {
176 let Pattern = pattern;
181 bits<7> Function = fun;
183 let Inst{25-21} = Ra;
184 let Inst{20-13} = LIT;
186 let Inst{11-5} = Function;
190 class OForm4L<bits<6> opcode, bits<7> fun, string asmstr>
191 : InstAlpha<opcode, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), asmstr> {
195 bits<7> Function = fun;
197 let isTwoAddress = 1;
198 let Inst{25-21} = Ra;
199 let Inst{20-13} = LIT;
201 let Inst{11-5} = Function;
206 class FPForm<bits<6> opcode, bits<11> fun, string asmstr, list<dag> pattern>
207 : InstAlphaAlt<opcode, asmstr> {
208 let Pattern = pattern;
213 bits<11> Function = fun;
215 let Inst{25-21} = Fa;
216 let Inst{20-16} = Fb;
217 let Inst{15-5} = Function;
222 class PALForm<bits<6> opcode, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> {
225 let Inst{25-0} = Function;
229 // Pseudo instructions.
230 class PseudoInstAlpha<dag OL, string nm, list<dag> pattern> : InstAlpha<0, OL, nm> {
231 let Pattern = pattern;