Fix bug: forgot branchTarget() method on indirect branches.
arch/alpha/isa_desc: Add missing branchTarget() method for indirect branches. cpu/static_inst.hh: Add comment clarifying when branchTarget() can be used on indirect branches. --HG-- extra : convert_revision : 0dcfb36a9792a338cefceb3d1501825abace7ac5
This commit is contained in:
parent
2f369ee5d5
commit
3e5070a3f1
2 changed files with 12 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue