summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/isa_desc7
-rw-r--r--cpu/static_inst.hh9
2 files changed, 12 insertions, 4 deletions
diff --git a/arch/alpha/isa_desc b/arch/alpha/isa_desc
index 3533da09f..51bce65c2 100644
--- a/arch/alpha/isa_desc
+++ b/arch/alpha/isa_desc
@@ -1287,6 +1287,13 @@ declare {{
{
}
+ Addr branchTarget(ExecContext *xc)
+ {
+ Addr NPC = xc->readPC() + 4;
+ uint64_t Rb = xc->readIntReg(_srcRegIdx[0]);
+ return (Rb & ~3) | (NPC & 1);
+ }
+
std::string generateDisassembly(Addr pc, const SymbolTable *symtab)
{
std::stringstream ss;
diff --git a/cpu/static_inst.hh b/cpu/static_inst.hh
index 644c7dfc4..f3fd6fa24 100644
--- a/cpu/static_inst.hh
+++ b/cpu/static_inst.hh
@@ -312,10 +312,11 @@ class StaticInst : public StaticInstBase
}
/**
- * Return the target address for an indirect branch (jump).
- * The register value is read from the supplied execution context.
- * Invalid if not an indirect branch (i.e. isIndirectCtrl()
- * should be true).
+ * Return the target address for an indirect branch (jump). The
+ * register value is read from the supplied execution context, so
+ * the result is valid only if the execution context is about to
+ * execute the branch in question. Invalid if not an indirect
+ * branch (i.e. isIndirectCtrl() should be true).
*/
virtual Addr branchTarget(ExecContext *xc)
{