blob: c465880d3e1a6f6210b4f6c202c47033450971d6 [file] [log] [blame]
Duraid Madina9b9d45f2005-03-17 18:17:03 +00001//===- IA64InstrFormats.td - IA64 Instruction Formats --*- tablegen -*-=//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Duraid Madina9b9d45f2005-03-17 18:17:03 +00007//
8//===----------------------------------------------------------------------===//
9//
10// - Warning: the stuff in here isn't really being used, so is mostly
11// junk. It'll get fixed as the JIT gets built.
12//
13//===----------------------------------------------------------------------===//
14
15//===----------------------------------------------------------------------===//
16// Instruction format superclass
17//===----------------------------------------------------------------------===//
18
Evan Cheng64d80e32007-07-19 01:14:50 +000019class InstIA64<bits<4> op, dag OOL, dag IOL, string asmstr> : Instruction {
Duraid Madina9b9d45f2005-03-17 18:17:03 +000020 // IA64 instruction baseline
21 field bits<41> Inst;
22 let Namespace = "IA64";
Evan Cheng64d80e32007-07-19 01:14:50 +000023 let OutOperandList = OOL;
24 let InOperandList = IOL;
Duraid Madina9b9d45f2005-03-17 18:17:03 +000025 let AsmString = asmstr;
26
27 let Inst{40-37} = op;
28}
29
30//"Each Itanium instruction is categorized into one of six types."
31//We should have:
32// A, I, M, F, B, L+X
33
Evan Cheng64d80e32007-07-19 01:14:50 +000034class AForm<bits<4> opcode, bits<6> qpReg, dag OOL, dag IOL, string asmstr> :
35 InstIA64<opcode, OOL, IOL, asmstr> {
Duraid Madina9b9d45f2005-03-17 18:17:03 +000036
37 let Inst{5-0} = qpReg;
38}
39
Evan Cheng64d80e32007-07-19 01:14:50 +000040class AForm_DAG<bits<4> opcode, bits<6> qpReg, dag OOL, dag IOL, string asmstr,
Duraid Madinaf2db9b82005-10-28 17:46:35 +000041 list<dag> pattern> :
Evan Cheng64d80e32007-07-19 01:14:50 +000042 InstIA64<opcode, OOL, IOL, asmstr> {
Duraid Madinaf2db9b82005-10-28 17:46:35 +000043
44 let Pattern = pattern;
45 let Inst{5-0} = qpReg;
46}
47
Duraid Madina9b9d45f2005-03-17 18:17:03 +000048let isBranch = 1, isTerminator = 1 in
Evan Cheng64d80e32007-07-19 01:14:50 +000049class BForm<bits<4> opcode, bits<6> x6, bits<3> btype, dag OOL, dag IOL, string asmstr> :
50 InstIA64<opcode, OOL, IOL, asmstr> {
Duraid Madina9b9d45f2005-03-17 18:17:03 +000051
52 let Inst{32-27} = x6;
53 let Inst{8-6} = btype;
54}
55
Evan Cheng64d80e32007-07-19 01:14:50 +000056class MForm<bits<4> opcode, bits<6> x6, dag OOL, dag IOL, string asmstr> :
57 InstIA64<opcode, OOL, IOL, asmstr> {
Duraid Madina9b9d45f2005-03-17 18:17:03 +000058 bits<7> Ra;
59 bits<7> Rb;
60 bits<16> disp;
61
62 let Inst{35-30} = x6;
63// let Inst{20-16} = Rb;
64 let Inst{15-0} = disp;
65}
66
Evan Cheng64d80e32007-07-19 01:14:50 +000067class RawForm<bits<4> opcode, bits<26> rest, dag OOL, dag IOL, string asmstr> :
68 InstIA64<opcode, OOL, IOL, asmstr> {
Duraid Madina9b9d45f2005-03-17 18:17:03 +000069 let Inst{25-0} = rest;
70}
71
72// Pseudo instructions.
Evan Cheng64d80e32007-07-19 01:14:50 +000073class PseudoInstIA64<dag OOL, dag IOL, string nm> : InstIA64<0, OOL, IOL, nm> {
Duraid Madina9b9d45f2005-03-17 18:17:03 +000074}
75
Evan Cheng64d80e32007-07-19 01:14:50 +000076class PseudoInstIA64_DAG<dag OOL, dag IOL, string nm, list<dag> pattern>
77 : InstIA64<0, OOL, IOL, nm> {
Duraid Madina363aff22005-10-31 01:42:11 +000078 let Pattern = pattern;
79}
Duraid Madina9b9d45f2005-03-17 18:17:03 +000080