pred.isa (6242:1cee707c1228) | pred.isa (6243:3a1698fbbc9f) |
---|---|
1// -*- mode:c++ -*- 2 3// Copyright (c) 2007-2008 The Florida State University 4// All rights reserved. 5// 6// Redistribution and use in source and binary forms, with or without 7// modification, are permitted provided that the following conditions are 8// met: redistributions of source code must retain the above copyright --- 147 unchanged lines hidden (view full) --- 156 PredOp(mnem, _machInst, __opClass) 157 { 158 flags[IsMicroop] = true; 159 } 160 }; 161 162}}; 163 | 1// -*- mode:c++ -*- 2 3// Copyright (c) 2007-2008 The Florida State University 4// All rights reserved. 5// 6// Redistribution and use in source and binary forms, with or without 7// modification, are permitted provided that the following conditions are 8// met: redistributions of source code must retain the above copyright --- 147 unchanged lines hidden (view full) --- 156 PredOp(mnem, _machInst, __opClass) 157 { 158 flags[IsMicroop] = true; 159 } 160 }; 161 162}}; 163 |
164let {{ 165 predicateTest = 'testPredicate(Cpsr, condCode)' 166}}; 167 |
|
164def template PredOpExecute {{ 165 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const 166 { 167 Fault fault = NoFault; | 168def template PredOpExecute {{ 169 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const 170 { 171 Fault fault = NoFault; |
168 169 %(fp_enable_check)s; | |
170 %(op_decl)s; 171 %(op_rd)s; | 172 %(op_decl)s; 173 %(op_rd)s; |
172 %(code)s; | |
173 | 174 |
174 if (testPredicate(xc->readMiscReg(ArmISA::MISCREG_CPSR), condCode)) | 175 if (%(predicate_test)s) |
175 { | 176 { |
177 %(fp_enable_check)s; 178 %(code)s; |
|
176 if (fault == NoFault) 177 { 178 %(op_wb)s; 179 } 180 } | 179 if (fault == NoFault) 180 { 181 %(op_wb)s; 182 } 183 } |
181 else 182 return NoFault; 183 // Predicated false instructions should not return faults | |
184 185 return fault; 186 } 187}}; 188 189//Outputs to decoder.cc 190output decoder {{ 191 std::string PredOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const --- 84 unchanged lines hidden (view full) --- 276 DPRINTF(Arm, "iz = %%d\\n", _iz); 277 DPRINTF(Arm, "ic = %%d\\n", _ic); 278 DPRINTF(Arm, "iv = %%d\\n", _iv); 279 ''' 280 281}}; 282 283def format PredOp(code, *opt_flags) {{ | 184 185 return fault; 186 } 187}}; 188 189//Outputs to decoder.cc 190output decoder {{ 191 std::string PredOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const --- 84 unchanged lines hidden (view full) --- 276 DPRINTF(Arm, "iz = %%d\\n", _iz); 277 DPRINTF(Arm, "ic = %%d\\n", _ic); 278 DPRINTF(Arm, "iv = %%d\\n", _iv); 279 ''' 280 281}}; 282 283def format PredOp(code, *opt_flags) {{ |
284 iop = InstObjParams(name, Name, 'PredOp', code, opt_flags) | 284 iop = InstObjParams(name, Name, 'PredOp', 285 {"code": code, 286 "predicate_test": predicateTest}, 287 opt_flags) |
285 header_output = BasicDeclare.subst(iop) 286 decoder_output = BasicConstructor.subst(iop) 287 decode_block = BasicDecode.subst(iop) 288 exec_output = PredOpExecute.subst(iop) 289}}; 290 291def format PredImmOp(code, *opt_flags) {{ | 288 header_output = BasicDeclare.subst(iop) 289 decoder_output = BasicConstructor.subst(iop) 290 decode_block = BasicDecode.subst(iop) 291 exec_output = PredOpExecute.subst(iop) 292}}; 293 294def format PredImmOp(code, *opt_flags) {{ |
292 iop = InstObjParams(name, Name, 'PredImmOp', code, opt_flags) | 295 iop = InstObjParams(name, Name, 'PredImmOp', 296 {"code": code, 297 "predicate_test": predicateTest}, 298 opt_flags) |
293 header_output = BasicDeclare.subst(iop) 294 decoder_output = BasicConstructor.subst(iop) 295 decode_block = BasicDecode.subst(iop) 296 exec_output = PredOpExecute.subst(iop) 297}}; 298 299def format PredImmOpCc(code, icValue, ivValue, *opt_flags) {{ 300 ccCode = calcCcCode % vars() 301 code += ccCode; 302 iop = InstObjParams(name, Name, 'PredImmOp', | 299 header_output = BasicDeclare.subst(iop) 300 decoder_output = BasicConstructor.subst(iop) 301 decode_block = BasicDecode.subst(iop) 302 exec_output = PredOpExecute.subst(iop) 303}}; 304 305def format PredImmOpCc(code, icValue, ivValue, *opt_flags) {{ 306 ccCode = calcCcCode % vars() 307 code += ccCode; 308 iop = InstObjParams(name, Name, 'PredImmOp', |
303 {"code": code, "cc_code": ccCode}, opt_flags) | 309 {"code": code, 310 "cc_code": ccCode, 311 "predicate_test": predicateTest}, 312 opt_flags) |
304 header_output = BasicDeclare.subst(iop) 305 decoder_output = BasicConstructor.subst(iop) 306 decode_block = BasicDecode.subst(iop) 307 exec_output = PredOpExecute.subst(iop) 308}}; 309 310def format PredIntOp(code, *opt_flags) {{ 311 new_code = ArmGenericCodeSubs(code) | 313 header_output = BasicDeclare.subst(iop) 314 decoder_output = BasicConstructor.subst(iop) 315 decode_block = BasicDecode.subst(iop) 316 exec_output = PredOpExecute.subst(iop) 317}}; 318 319def format PredIntOp(code, *opt_flags) {{ 320 new_code = ArmGenericCodeSubs(code) |
312 iop = InstObjParams(name, Name, 'PredIntOp', new_code, opt_flags) | 321 iop = InstObjParams(name, Name, 'PredIntOp', 322 {"code": new_code, 323 "predicate_test": predicateTest}, 324 opt_flags) |
313 header_output = BasicDeclare.subst(iop) 314 decoder_output = BasicConstructor.subst(iop) 315 decode_block = BasicDecode.subst(iop) 316 exec_output = PredOpExecute.subst(iop) 317}}; 318 319def format PredIntOpCc(code, icValue, ivValue, *opt_flags) {{ 320 ccCode = calcCcCode % vars() 321 code += ccCode; 322 new_code = ArmGenericCodeSubs(code) 323 iop = InstObjParams(name, Name, 'PredIntOp', | 325 header_output = BasicDeclare.subst(iop) 326 decoder_output = BasicConstructor.subst(iop) 327 decode_block = BasicDecode.subst(iop) 328 exec_output = PredOpExecute.subst(iop) 329}}; 330 331def format PredIntOpCc(code, icValue, ivValue, *opt_flags) {{ 332 ccCode = calcCcCode % vars() 333 code += ccCode; 334 new_code = ArmGenericCodeSubs(code) 335 iop = InstObjParams(name, Name, 'PredIntOp', |
324 {"code": new_code, "cc_code": ccCode }, opt_flags) | 336 {"code": new_code, 337 "cc_code": ccCode, 338 "predicate_test": predicateTest}, 339 opt_flags) |
325 header_output = BasicDeclare.subst(iop) 326 decoder_output = BasicConstructor.subst(iop) 327 decode_block = BasicDecode.subst(iop) 328 exec_output = PredOpExecute.subst(iop) 329}}; 330 | 340 header_output = BasicDeclare.subst(iop) 341 decoder_output = BasicConstructor.subst(iop) 342 decode_block = BasicDecode.subst(iop) 343 exec_output = PredOpExecute.subst(iop) 344}}; 345 |