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 InstAlpha<bits<6> op, string asmstr, InstrItinClass itin> : Instruction {
32 let Namespace = "Alpha";
33 let AsmString = asmstr;
40 class MForm<bits<6> opcode, bit store, bit load, string asmstr, list<dag> pattern, InstrItinClass itin>
41 : InstAlpha<opcode, asmstr, itin> {
42 let Pattern = pattern;
45 let Defs = [R28]; //We may use this for frame index calculations, so reserve it here
53 let Inst{15-0} = disp;
55 class MfcForm<bits<6> opcode, bits<16> fc, string asmstr, InstrItinClass itin>
56 : InstAlpha<opcode, asmstr, itin> {
59 let OperandList = (ops GPRC:$RA);
65 class MbrForm<bits<6> opcode, bits<2> TB, dag OL, string asmstr, InstrItinClass itin>
66 : InstAlpha<opcode, asmstr, itin> {
76 let Inst{13-0} = disp;
80 def target : Operand<OtherVT> {}
81 let isBranch = 1, isTerminator = 1 in
82 class BFormD<bits<6> opcode, string asmstr, list<dag> pattern, InstrItinClass itin>
83 : InstAlpha<opcode, asmstr, itin> {
84 let Pattern = pattern;
85 let OperandList = (ops target:$DISP);
90 let Inst{20-0} = disp;
92 let isBranch = 1, isTerminator = 1 in
93 class BForm<bits<6> opcode, string asmstr, list<dag> pattern, InstrItinClass itin>
94 : InstAlpha<opcode, asmstr, itin> {
95 let Pattern = pattern;
96 let OperandList = (ops GPRC:$RA, target:$DISP);
101 let Inst{25-21} = Ra;
102 let Inst{20-0} = disp;
105 let isBranch = 1, isTerminator = 1 in
106 class FBForm<bits<6> opcode, string asmstr, list<dag> pattern, InstrItinClass itin>
107 : InstAlpha<opcode, asmstr, itin> {
108 let Pattern = pattern;
109 let OperandList = (ops F8RC:$RA, target:$DISP);
114 let Inst{25-21} = Ra;
115 let Inst{20-0} = disp;
119 class OForm<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
120 : InstAlpha<opcode, asmstr, itin> {
121 let Pattern = pattern;
122 let OperandList = (ops GPRC:$RC, GPRC:$RA, GPRC:$RB);
127 bits<7> Function = fun;
129 let Inst{25-21} = Ra;
130 let Inst{20-16} = Rb;
133 let Inst{11-5} = Function;
137 class OForm2<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
138 : InstAlpha<opcode, asmstr, itin> {
139 let Pattern = pattern;
140 let OperandList = (ops GPRC:$RC, GPRC:$RB);
144 bits<7> Function = fun;
146 let Inst{25-21} = 31;
147 let Inst{20-16} = Rb;
150 let Inst{11-5} = Function;
154 class OForm4<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
155 : InstAlpha<opcode, asmstr, itin> {
156 let Pattern = pattern;
157 let OperandList = (ops GPRC:$RDEST, GPRC:$RFALSE, GPRC:$RTRUE, GPRC:$RCOND);
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, InstrItinClass itin>
175 : InstAlpha<opcode, asmstr, itin> {
176 let Pattern = pattern;
177 let OperandList = (ops GPRC:$RC, GPRC:$RA, u8imm:$L);
182 bits<7> Function = fun;
184 let Inst{25-21} = Ra;
185 let Inst{20-13} = LIT;
187 let Inst{11-5} = Function;
191 class OForm4L<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
192 : InstAlpha<opcode, asmstr, itin> {
193 let Pattern = pattern;
194 let OperandList = (ops GPRC:$RDEST, GPRC:$RFALSE, s64imm:$RTRUE, GPRC:$RCOND);
199 bits<7> Function = fun;
201 let isTwoAddress = 1;
202 let Inst{25-21} = Ra;
203 let Inst{20-13} = LIT;
205 let Inst{11-5} = Function;
210 class FPForm<bits<6> opcode, bits<11> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
211 : InstAlpha<opcode, asmstr, itin> {
212 let Pattern = pattern;
217 bits<11> Function = fun;
219 let Inst{25-21} = Fa;
220 let Inst{20-16} = Fb;
221 let Inst{15-5} = Function;
226 class PALForm<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin>
227 : InstAlpha<opcode, asmstr, itin> {
228 let OperandList = OL;
231 let Inst{25-0} = Function;
235 // Pseudo instructions.
236 class PseudoInstAlpha<dag OL, string nm, list<dag> pattern, InstrItinClass itin>
237 : InstAlpha<0, nm, itin> {
238 let OperandList = OL;
239 let Pattern = pattern;