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