specop.isa (7087:fb8d5786ff30) specop.isa (7620:3d8a23caa1ef)
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// The license below extends only to copyright in the software and shall
5// not be construed as granting a license to any other intellectual
6// property including but not limited to intellectual property relating
7// to a hardware implementation of the functionality of the software
8// licensed hereunder. You may use the software subject to the license

--- 36 unchanged lines hidden (view full) ---

45 class MicroFaultBase : public X86ISA::X86MicroopBase
46 {
47 protected:
48 Fault fault;
49 uint8_t cc;
50
51 public:
52 MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// The license below extends only to copyright in the software and shall
5// not be construed as granting a license to any other intellectual
6// property including but not limited to intellectual property relating
7// to a hardware implementation of the functionality of the software
8// licensed hereunder. You may use the software subject to the license

--- 36 unchanged lines hidden (view full) ---

45 class MicroFaultBase : public X86ISA::X86MicroopBase
46 {
47 protected:
48 Fault fault;
49 uint8_t cc;
50
51 public:
52 MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
53 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
54 Fault _fault, uint8_t _cc);
53 uint64_t setFlags, Fault _fault, uint8_t _cc);
55
56 MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
57 Fault _fault, uint8_t _cc);
58
59 std::string generateDisassembly(Addr pc,
60 const SymbolTable *symtab) const;
61 };
62
63 class MicroHalt : public X86ISA::X86MicroopBase
64 {
65 public:
66 MicroHalt(ExtMachInst _machInst, const char * instMnem,
54
55 MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
56 Fault _fault, uint8_t _cc);
57
58 std::string generateDisassembly(Addr pc,
59 const SymbolTable *symtab) const;
60 };
61
62 class MicroHalt : public X86ISA::X86MicroopBase
63 {
64 public:
65 MicroHalt(ExtMachInst _machInst, const char * instMnem,
67 bool isMicro, bool isDelayed, bool isFirst, bool isLast) :
68 X86MicroopBase(_machInst, "halt", instMnem,
69 isMicro, isDelayed, isFirst, isLast, No_OpClass)
66 uint64_t setFlags) :
67 X86MicroopBase(_machInst, "halt", instMnem, setFlags, No_OpClass)
70 {
71 }
72
73 MicroHalt(ExtMachInst _machInst, const char * instMnem) :
68 {
69 }
70
71 MicroHalt(ExtMachInst _machInst, const char * instMnem) :
74 X86MicroopBase(_machInst, "halt", instMnem,
75 false, false, false, false, No_OpClass)
72 X86MicroopBase(_machInst, "halt", instMnem, 0, No_OpClass)
76 {
77 }
78
79 %(BasicExecDeclare)s
80
81 std::string generateDisassembly(Addr pc,
82 const SymbolTable *symtab) const;
83 };
84}};
85
86def template MicroFaultDeclare {{
87 class %(class_name)s : public %(base_class)s
88 {
89 private:
90 void buildMe();
91 public:
92 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
73 {
74 }
75
76 %(BasicExecDeclare)s
77
78 std::string generateDisassembly(Addr pc,
79 const SymbolTable *symtab) const;
80 };
81}};
82
83def template MicroFaultDeclare {{
84 class %(class_name)s : public %(base_class)s
85 {
86 private:
87 void buildMe();
88 public:
89 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
93 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
94 Fault _fault, uint8_t _cc);
90 uint64_t setFlags, Fault _fault, uint8_t _cc);
95
96 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
97 Fault _fault, uint8_t _cc);
98
99 %(BasicExecDeclare)s
100 };
101}};
102

--- 21 unchanged lines hidden (view full) ---

124 return NoFault;
125 }
126}};
127
128output decoder {{
129 inline MicroFaultBase::MicroFaultBase(
130 ExtMachInst machInst, const char * instMnem,
131 Fault _fault, uint8_t _cc) :
91
92 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
93 Fault _fault, uint8_t _cc);
94
95 %(BasicExecDeclare)s
96 };
97}};
98

--- 21 unchanged lines hidden (view full) ---

120 return NoFault;
121 }
122}};
123
124output decoder {{
125 inline MicroFaultBase::MicroFaultBase(
126 ExtMachInst machInst, const char * instMnem,
127 Fault _fault, uint8_t _cc) :
132 X86MicroopBase(machInst, "fault", instMnem,
133 false, false, false, false, No_OpClass),
128 X86MicroopBase(machInst, "fault", instMnem, 0, No_OpClass),
134 fault(_fault), cc(_cc)
135 {
136 }
137
138 inline MicroFaultBase::MicroFaultBase(
139 ExtMachInst machInst, const char * instMnem,
129 fault(_fault), cc(_cc)
130 {
131 }
132
133 inline MicroFaultBase::MicroFaultBase(
134 ExtMachInst machInst, const char * instMnem,
140 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
141 Fault _fault, uint8_t _cc) :
142 X86MicroopBase(machInst, "fault", instMnem,
143 isMicro, isDelayed, isFirst, isLast, No_OpClass),
135 uint64_t setFlags, Fault _fault, uint8_t _cc) :
136 X86MicroopBase(machInst, "fault", instMnem, setFlags, No_OpClass),
144 fault(_fault), cc(_cc)
145 {
146 }
147}};
148
149def template MicroFaultConstructor {{
150
151 inline void %(class_name)s::buildMe()

--- 5 unchanged lines hidden (view full) ---

157 ExtMachInst machInst, const char * instMnem,
158 Fault _fault, uint8_t _cc) :
159 %(base_class)s(machInst, instMnem, _fault, _cc)
160 {
161 buildMe();
162 }
163
164 inline %(class_name)s::%(class_name)s(
137 fault(_fault), cc(_cc)
138 {
139 }
140}};
141
142def template MicroFaultConstructor {{
143
144 inline void %(class_name)s::buildMe()

--- 5 unchanged lines hidden (view full) ---

150 ExtMachInst machInst, const char * instMnem,
151 Fault _fault, uint8_t _cc) :
152 %(base_class)s(machInst, instMnem, _fault, _cc)
153 {
154 buildMe();
155 }
156
157 inline %(class_name)s::%(class_name)s(
165 ExtMachInst machInst, const char * instMnem,
166 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
158 ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
167 Fault _fault, uint8_t _cc) :
159 Fault _fault, uint8_t _cc) :
168 %(base_class)s(machInst, instMnem,
169 isMicro, isDelayed, isFirst, isLast, _fault, _cc)
160 %(base_class)s(machInst, instMnem, setFlags, _fault, _cc)
170 {
171 buildMe();
172 }
173}};
174
175output decoder {{
176 std::string MicroFaultBase::generateDisassembly(Addr pc,
177 const SymbolTable *symtab) const

--- 28 unchanged lines hidden (view full) ---

206 if flags:
207 if not isinstance(flags, (list, tuple)):
208 raise Exception, "flags must be a list or tuple of flags"
209 self.cond = " | ".join(flags)
210 self.className += "Flags"
211 else:
212 self.cond = "0"
213
161 {
162 buildMe();
163 }
164}};
165
166output decoder {{
167 std::string MicroFaultBase::generateDisassembly(Addr pc,
168 const SymbolTable *symtab) const

--- 28 unchanged lines hidden (view full) ---

197 if flags:
198 if not isinstance(flags, (list, tuple)):
199 raise Exception, "flags must be a list or tuple of flags"
200 self.cond = " | ".join(flags)
201 self.className += "Flags"
202 else:
203 self.cond = "0"
204
214 def getAllocator(self, *microFlags):
215 allocator = '''new %(class_name)s(machInst, macrocodeBlock
205 def getAllocator(self, microFlags):
206 allocator = '''new %(class_name)s(machInst, macrocodeBlock,
216 %(flags)s, %(fault)s, %(cc)s)''' % {
217 "class_name" : self.className,
218 "flags" : self.microFlagsText(microFlags),
219 "fault" : self.fault,
220 "cc" : self.cond}
221 return allocator
222
223 iop = InstObjParams("fault", "MicroFaultFlags", "MicroFaultBase",

--- 10 unchanged lines hidden (view full) ---

234 decoder_output += MicroFaultConstructor.subst(iop)
235 microopClasses["fault"] = Fault
236
237 class Halt(X86Microop):
238 className = "MicroHalt"
239 def __init__(self):
240 pass
241
207 %(flags)s, %(fault)s, %(cc)s)''' % {
208 "class_name" : self.className,
209 "flags" : self.microFlagsText(microFlags),
210 "fault" : self.fault,
211 "cc" : self.cond}
212 return allocator
213
214 iop = InstObjParams("fault", "MicroFaultFlags", "MicroFaultBase",

--- 10 unchanged lines hidden (view full) ---

225 decoder_output += MicroFaultConstructor.subst(iop)
226 microopClasses["fault"] = Fault
227
228 class Halt(X86Microop):
229 className = "MicroHalt"
230 def __init__(self):
231 pass
232
242 def getAllocator(self, *microFlags):
243 return "new MicroHalt(machInst, macrocodeBlock %s)" % \
233 def getAllocator(self, microFlags):
234 return "new MicroHalt(machInst, macrocodeBlock, %s)" % \
244 self.microFlagsText(microFlags)
245
246 microopClasses["halt"] = Halt
247}};
235 self.microFlagsText(microFlags)
236
237 microopClasses["halt"] = Halt
238}};