summaryrefslogtreecommitdiff
path: root/src/arch/sparc/isa/formats
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-12-08 00:27:43 -0800
committerGabe Black <gblack@eecs.umich.edu>2010-12-08 00:27:43 -0800
commitf01d2efe8a106692fd83936d3c6d3565a001616c (patch)
treef1afbc4091f83a03cf3fd566927d36e9ed88cfd2 /src/arch/sparc/isa/formats
parentd3e021820eb9916d63b96ba732ccc0783626433b (diff)
downloadgem5-f01d2efe8a106692fd83936d3c6d3565a001616c.tar.xz
SPARC: Take advantage of new PCState syntax.
Diffstat (limited to 'src/arch/sparc/isa/formats')
-rw-r--r--src/arch/sparc/isa/formats/branch.isa17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/arch/sparc/isa/formats/branch.isa b/src/arch/sparc/isa/formats/branch.isa
index b7d0dde72..bf2d9a748 100644
--- a/src/arch/sparc/isa/formats/branch.isa
+++ b/src/arch/sparc/isa/formats/branch.isa
@@ -195,7 +195,6 @@ def template JumpExecute {{
%(op_decl)s;
%(op_rd)s;
- PCS = PCS;
%(code)s;
if (fault == NoFault) {
@@ -242,6 +241,7 @@ def template BranchDecode {{
// Primary format for branch instructions:
def format Branch(code, *opt_flags) {{
+ code = 'NNPC = NNPC;\n' + code
(usesImm, code, immCode,
rString, iString) = splitOutImm(code)
iop = InstObjParams(name, Name, 'Branch', code, opt_flags)
@@ -290,24 +290,15 @@ let {{
def doCondBranch(name, Name, base, cond, code, opt_flags):
return doBranch(name, Name, base, cond, code, code,
- 'PCS = PCS;',
- '''
- SparcISA::PCState pc = PCS;
- pc.nnpc(pc.npc() + 8);
- pc.npc(pc.npc() + 4);
- PCS = pc;
- ''',
+ 'NNPC = NNPC; NPC = NPC;\n',
+ 'NNPC = NPC + 8; NPC = NPC + 4;\n',
opt_flags)
def doUncondBranch(name, Name, base, code, annul_code, opt_flags):
return doBranch(name, Name, base, "true", code, annul_code,
";", ";", opt_flags)
- default_branch_code = '''
- SparcISA::PCState pc = PCS;
- pc.nnpc(pc.pc() + disp);
- PCS = pc;
- '''
+ default_branch_code = 'NNPC = PC + disp;\n'
}};
// Format for branch instructions with n bit displacements: