Deleted Added
sdiff udiff text old ( 5661:443e6f925027 ) new ( 5662:4f3371a1c58c )
full compact
1// Copyright (c) 2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

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

164 printMnemonic(response, instMnem, mnemonic);
165 ccprintf(response, "%#x", target);
166
167 return response.str();
168 }
169}};
170
171let {{
172 class Br(X86Microop):
173 className = "MicroBranch"
174 def __init__(self, target, flags=None):
175 self.target = target
176 if flags:
177 if not isinstance(flags, (list, tuple)):
178 raise Exception, "flags must be a list or tuple of flags"
179 self.cond = " | ".join(flags)
180 self.className += "Flags"
181 else:
182 self.cond = "0"
183
184 def getAllocator(self, *microFlags):
185 allocator = '''new %(class_name)s(machInst, mnemonic
186 %(flags)s, %(target)s, %(cc)s)''' % {
187 "class_name" : self.className,
188 "flags" : self.microFlagsText(microFlags),
189 "target" : self.target,
190 "cc" : self.cond}
191 return allocator
192
193 iop = InstObjParams("br", "MicroBranchFlags", "SeqOpBase",
194 {"code": "nuIP = target",
195 "else_code": "nuIP = nuIP",
196 "cond_test": "checkCondition(ccFlagBits, cc)"})
197 exec_output += SeqOpExecute.subst(iop)
198 header_output += SeqOpDeclare.subst(iop)
199 decoder_output += SeqOpConstructor.subst(iop)
200 iop = InstObjParams("br", "MicroBranch", "SeqOpBase",
201 {"code": "nuIP = target",
202 "else_code": "nuIP = nuIP",
203 "cond_test": "true"})
204 exec_output += SeqOpExecute.subst(iop)
205 header_output += SeqOpDeclare.subst(iop)
206 decoder_output += SeqOpConstructor.subst(iop)
207 microopClasses["br"] = Br
208}};