diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2010-12-08 10:45:14 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2010-12-08 10:45:14 -0800 |
commit | f26051eb1a5b8f3522acbb871133de66278fd517 (patch) | |
tree | 14b927d6d61bc4f2a36fccead9b0da13f2a7fb34 /src/arch/mips/isa/formats | |
parent | 7f3f90f71d6993f8a712294e40fe8723bc3d7dbc (diff) | |
download | gem5-f26051eb1a5b8f3522acbb871133de66278fd517.tar.xz |
MIPS: Take advantage of new PCState syntax.
Diffstat (limited to 'src/arch/mips/isa/formats')
-rw-r--r-- | src/arch/mips/isa/formats/branch.isa | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/arch/mips/isa/formats/branch.isa b/src/arch/mips/isa/formats/branch.isa index 232a743a7..ecc62d75d 100644 --- a/src/arch/mips/isa/formats/branch.isa +++ b/src/arch/mips/isa/formats/branch.isa @@ -225,16 +225,16 @@ output decoder {{ }}; def format Branch(code, *opt_flags) {{ - not_taken_code = '' + not_taken_code = 'NNPC = NNPC; NPC = NPC;' #Build Instruction Flags #Use Link & Likely Flags to Add Link/Condition Code inst_flags = ('IsDirectControl', ) for x in opt_flags: if x == 'Link': - code += 'R31 = pc.nnpc();\n' + code += 'R31 = NNPC;\n' elif x == 'Likely': - not_taken_code = 'pc.advance();' + not_taken_code = 'NNPC = NPC; NPC = PC;' inst_flags += ('IsCondDelaySlot', ) else: inst_flags += (x, ) @@ -248,14 +248,12 @@ def format Branch(code, *opt_flags) {{ #Condition code code = ''' bool cond; - MipsISA::PCState pc = PCS; %(code)s if (cond) { - pc.nnpc(pc.npc() + disp); + NNPC = NPC + disp; } else { %(not_taken_code)s } - PCS = pc; ''' % { "code" : code, "not_taken_code" : not_taken_code } iop = InstObjParams(name, Name, 'Branch', code, inst_flags) @@ -266,16 +264,16 @@ def format Branch(code, *opt_flags) {{ }}; def format DspBranch(code, *opt_flags) {{ - not_taken_code = '' + not_taken_code = 'NNPC = NNPC; NPC = NPC;' #Build Instruction Flags #Use Link & Likely Flags to Add Link/Condition Code inst_flags = ('IsDirectControl', ) for x in opt_flags: if x == 'Link': - code += 'R32 = pc.nnpc();' + code += 'R32 = NNPC;' elif x == 'Likely': - not_taken_code = 'pc.advance();' + not_taken_code = 'NNPC = NPC, NPC = PC;' inst_flags += ('IsCondDelaySlot', ) else: inst_flags += (x, ) @@ -288,16 +286,14 @@ def format DspBranch(code, *opt_flags) {{ #Condition code code = ''' - MipsISA::PCState pc = PCS; bool cond; uint32_t dspctl = DSPControl; %(code)s if (cond) { - pc.nnpc(pc.npc() + disp); + NNPC = NPC + disp; } else { %(not_taken_code)s } - PCS = pc; ''' % { "code" : code, "not_taken_code" : not_taken_code } iop = InstObjParams(name, Name, 'Branch', code, inst_flags) @@ -314,17 +310,13 @@ def format Jump(code, *opt_flags) {{ for x in opt_flags: if x == 'Link': code = ''' - R31 = pc.nnpc(); + R31 = NNPC; ''' + code elif x == 'ClearHazards': code += '/* Code Needed to Clear Execute & Inst Hazards */\n' else: inst_flags += (x, ) - code = ''' - MipsISA::PCState pc = PCS; - ''' + code - iop = InstObjParams(name, Name, 'Jump', code, inst_flags) header_output = BasicDeclare.subst(iop) decoder_output = BasicConstructor.subst(iop) |