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