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;
48 let Defs = [R28]; //We may use this for frame index calculations, so reserve it here
56 let Inst{15-0} = disp;
59 class MfcForm<bits<6> opcode, bits<16> fc, string asmstr>
60 : InstAlpha<opcode, (ops GPRC:$RA), asmstr> {
68 class MbrForm<bits<6> opcode, bits<2> TB, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> {
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>
83 : InstAlpha<opcode, (ops target:$DISP), asmstr> {
84 let Pattern = pattern;
90 let Inst{20-0} = disp;
92 let isBranch = 1, isTerminator = 1 in
93 class BForm<bits<6> opcode, string asmstr, list<dag> pattern>
94 : InstAlpha<opcode, (ops GPRC:$RA, target:$DISP), asmstr> {
95 let Pattern = pattern;
100 let Inst{25-21} = Ra;
101 let Inst{20-0} = disp;
104 let isBranch = 1, isTerminator = 1 in
105 class FBForm<bits<6> opcode, string asmstr, list<dag> pattern>
106 : InstAlpha<opcode, (ops F8RC:$RA, target:$DISP), asmstr> {
107 let Pattern = pattern;
112 let Inst{25-21} = Ra;
113 let Inst{20-0} = disp;
117 class OForm<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
118 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RA, GPRC:$RB), asmstr> {
119 let Pattern = pattern;
124 bits<7> Function = fun;
126 let Inst{25-21} = Ra;
127 let Inst{20-16} = Rb;
130 let Inst{11-5} = Function;
134 class OForm2<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
135 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RB), asmstr> {
136 let Pattern = pattern;
140 bits<7> Function = fun;
142 let Inst{25-21} = 31;
143 let Inst{20-16} = Rb;
146 let Inst{11-5} = Function;
150 class OForm4<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
151 : InstAlpha<opcode, (ops GPRC:$RDEST, GPRC:$RFALSE, GPRC:$RTRUE, GPRC:$RCOND), asmstr> {
152 let Pattern = pattern;
157 bits<7> Function = fun;
159 let isTwoAddress = 1;
160 let Inst{25-21} = Ra;
161 let Inst{20-16} = Rb;
164 let Inst{11-5} = Function;
169 class OFormL<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
170 : InstAlpha<opcode, (ops GPRC:$RC, GPRC:$RA, u8imm:$L), asmstr> {
171 let Pattern = pattern;
176 bits<7> Function = fun;
178 let Inst{25-21} = Ra;
179 let Inst{20-13} = LIT;
181 let Inst{11-5} = Function;
185 class OForm4L<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern>
186 : InstAlpha<opcode, (ops GPRC:$RDEST, GPRC:$RFALSE, s64imm:$RTRUE, GPRC:$RCOND), asmstr> {
187 let Pattern = pattern;
192 bits<7> Function = fun;
194 let isTwoAddress = 1;
195 let Inst{25-21} = Ra;
196 let Inst{20-13} = LIT;
198 let Inst{11-5} = Function;
203 class FPForm<bits<6> opcode, bits<11> fun, string asmstr, list<dag> pattern>
204 : InstAlphaAlt<opcode, asmstr> {
205 let Pattern = pattern;
210 bits<11> Function = fun;
212 let Inst{25-21} = Fa;
213 let Inst{20-16} = Fb;
214 let Inst{15-5} = Function;
219 class PALForm<bits<6> opcode, dag OL, string asmstr> : InstAlpha<opcode, OL, asmstr> {
222 let Inst{25-0} = Function;
226 // Pseudo instructions.
227 class PseudoInstAlpha<dag OL, string nm, list<dag> pattern> : InstAlpha<0, OL, nm> {
228 let Pattern = pattern;