branch.isa (2980:eab855f06b79) branch.isa (3951:727778d649ae)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2006 The Regents of The University of Michigan
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

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

242
243 #Condition code
244 code = 'bool cond;\n' + code
245 code += 'if (cond) {\n'
246 code += ' NNPC = NPC + disp;\n'
247 code += '} else {\n'
248 code += not_taken_code
249
1// -*- mode:c++ -*-
2
3// Copyright (c) 2006 The Regents of The University of Michigan
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

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

242
243 #Condition code
244 code = 'bool cond;\n' + code
245 code += 'if (cond) {\n'
246 code += ' NNPC = NPC + disp;\n'
247 code += '} else {\n'
248 code += not_taken_code
249
250 iop = InstObjParams(name, Name, 'Branch', CodeBlock(code), inst_flags)
250 iop = InstObjParams(name, Name, 'Branch', code, inst_flags)
251 header_output = BasicDeclare.subst(iop)
252 decoder_output = BasicConstructor.subst(iop)
253 decode_block = BasicDecode.subst(iop)
254 exec_output = BasicExecute.subst(iop)
255}};
256
257def format Jump(code, *opt_flags) {{
258 #Build Instruction Flags
259 #Use Link Flag to Add Link Code
260 inst_flags = ('IsIndirectControl', 'IsUncondControl')
261 for x in opt_flags:
262 if x == 'Link':
263 code = 'R31 = NNPC;\n' + code
264 elif x == 'ClearHazards':
265 code += '/* Code Needed to Clear Execute & Inst Hazards */\n'
266 else:
267 inst_flags += (x, )
268
251 header_output = BasicDeclare.subst(iop)
252 decoder_output = BasicConstructor.subst(iop)
253 decode_block = BasicDecode.subst(iop)
254 exec_output = BasicExecute.subst(iop)
255}};
256
257def format Jump(code, *opt_flags) {{
258 #Build Instruction Flags
259 #Use Link Flag to Add Link Code
260 inst_flags = ('IsIndirectControl', 'IsUncondControl')
261 for x in opt_flags:
262 if x == 'Link':
263 code = 'R31 = NNPC;\n' + code
264 elif x == 'ClearHazards':
265 code += '/* Code Needed to Clear Execute & Inst Hazards */\n'
266 else:
267 inst_flags += (x, )
268
269 iop = InstObjParams(name, Name, 'Jump', CodeBlock(code), inst_flags)
269 iop = InstObjParams(name, Name, 'Jump', code, inst_flags)
270 header_output = BasicDeclare.subst(iop)
271 decoder_output = BasicConstructor.subst(iop)
272 decode_block = BasicDecode.subst(iop)
273 exec_output = BasicExecute.subst(iop)
274}};
275
276
277
278
270 header_output = BasicDeclare.subst(iop)
271 decoder_output = BasicConstructor.subst(iop)
272 decode_block = BasicDecode.subst(iop)
273 exec_output = BasicExecute.subst(iop)
274}};
275
276
277
278