changeset 5e424aa952c5 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=5e424aa952c5
description:
        arm: Mark v7 cbz instructions as direct branches

        v7 cbz/cbnz instructions were improperly marked as indirect branches.

diffstat:

 src/arch/arm/isa/insts/branch.isa     |  11 +++++++----
 src/arch/arm/isa/templates/branch.isa |   6 +++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diffs (52 lines):

diff -r 6be8945d226b -r 5e424aa952c5 src/arch/arm/isa/insts/branch.isa
--- a/src/arch/arm/isa/insts/branch.isa Wed Sep 03 07:42:39 2014 -0400
+++ b/src/arch/arm/isa/insts/branch.isa Wed Sep 03 07:42:40 2014 -0400
@@ -1,6 +1,6 @@
 // -*- mode:c++ -*-
 
-// Copyright (c) 2010-2012 ARM Limited
+// Copyright (c) 2010-2012, 2014 ARM Limited
 // All rights reserved
 //
 // The license below extends only to copyright in the software and shall
@@ -174,12 +174,15 @@
     #CBNZ, CBZ. These are always unconditional as far as predicates
     for (mnem, test) in (("cbz", "=="), ("cbnz", "!=")):
         code = 'NPC = (uint32_t)(PC + imm);\n'
+        br_tgt_code = '''pcs.instNPC((uint32_t)(branchPC.instPC() + imm));'''
         predTest = "Op1 %(test)s 0" % {"test": test}
         iop = InstObjParams(mnem, mnem.capitalize(), "BranchImmReg",
-                            {"code": code, "predicate_test": predTest},
-                            ["IsIndirectControl"])
+                            {"code": code, "predicate_test": predTest,
+                            "brTgtCode" : br_tgt_code},
+                            ["IsDirectControl"])
         header_output += BranchImmRegDeclare.subst(iop)
-        decoder_output += BranchImmRegConstructor.subst(iop)
+        decoder_output += BranchImmRegConstructor.subst(iop) + \
+                          BranchTarget.subst(iop)
         exec_output += PredOpExecute.subst(iop)
 
     #TBB, TBH
diff -r 6be8945d226b -r 5e424aa952c5 src/arch/arm/isa/templates/branch.isa
--- a/src/arch/arm/isa/templates/branch.isa     Wed Sep 03 07:42:39 2014 -0400
+++ b/src/arch/arm/isa/templates/branch.isa     Wed Sep 03 07:42:40 2014 -0400
@@ -1,6 +1,6 @@
 // -*- mode:c++ -*-
 
-// Copyright (c) 2010 ARM Limited
+// Copyright (c) 2010, 2014 ARM Limited
 // All rights reserved
 //
 // The license below extends only to copyright in the software and shall
@@ -212,6 +212,10 @@
         %(class_name)s(ExtMachInst machInst,
                        int32_t imm, IntRegIndex _op1);
         %(BasicExecDeclare)s
+        ArmISA::PCState branchTarget(const ArmISA::PCState &branchPC) const;
+
+        /// Explicitly import the otherwise hidden branchTarget
+        using StaticInst::branchTarget;
 };
 }};
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to