seqop.isa (5661:443e6f925027) | seqop.isa (5662:4f3371a1c58c) |
---|---|
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 {{ | 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" | 172 class SeqOp(X86Microop): |
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 | 173 def __init__(self, target, flags=None): 174 self.target = target 175 if flags: 176 if not isinstance(flags, (list, tuple)): 177 raise Exception, "flags must be a list or tuple of flags" 178 self.cond = " | ".join(flags) 179 self.className += "Flags" 180 else: 181 self.cond = "0" 182 183 def getAllocator(self, *microFlags): 184 allocator = '''new %(class_name)s(machInst, mnemonic 185 %(flags)s, %(target)s, %(cc)s)''' % { 186 "class_name" : self.className, 187 "flags" : self.microFlagsText(microFlags), 188 "target" : self.target, 189 "cc" : self.cond} 190 return allocator 191 |
192 class Br(SeqOp): 193 className = "MicroBranch" 194 195 def getAllocator(self, *microFlags): 196 (is_micro, is_delayed, is_first, is_last) = microFlags 197 is_last = False 198 microFlags = (is_micro, is_delayed, is_first, is_last) 199 return super(Br, self).getAllocator(*microFlags) 200 |
|
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}}; | 201 iop = InstObjParams("br", "MicroBranchFlags", "SeqOpBase", 202 {"code": "nuIP = target", 203 "else_code": "nuIP = nuIP", 204 "cond_test": "checkCondition(ccFlagBits, cc)"}) 205 exec_output += SeqOpExecute.subst(iop) 206 header_output += SeqOpDeclare.subst(iop) 207 decoder_output += SeqOpConstructor.subst(iop) 208 iop = InstObjParams("br", "MicroBranch", "SeqOpBase", 209 {"code": "nuIP = target", 210 "else_code": "nuIP = nuIP", 211 "cond_test": "true"}) 212 exec_output += SeqOpExecute.subst(iop) 213 header_output += SeqOpDeclare.subst(iop) 214 decoder_output += SeqOpConstructor.subst(iop) 215 microopClasses["br"] = Br 216}}; |