branch.isa (2665:a124942bacb8) branch.isa (2680:246e7104f744)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2005 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

--- 92 unchanged lines hidden (view full) ---

101 public:
102 /// Constructor
103 Jump(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
104 : PCDependentDisassembly(mnem, _machInst, __opClass),
105 disp(BRDISP)
106 {
107 }
108
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2005 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

--- 92 unchanged lines hidden (view full) ---

101 public:
102 /// Constructor
103 Jump(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
104 : PCDependentDisassembly(mnem, _machInst, __opClass),
105 disp(BRDISP)
106 {
107 }
108
109 Addr branchTarget(ExecContext *xc) const;
109 Addr branchTarget(ThreadContext *tc) const;
110
111 std::string
112 generateDisassembly(Addr pc, const SymbolTable *symtab) const;
113 };
114}};
115
116output decoder {{
117 Addr
118 Branch::branchTarget(Addr branchPC) const
119 {
120 return branchPC + 4 + disp;
121 }
122
123 Addr
110
111 std::string
112 generateDisassembly(Addr pc, const SymbolTable *symtab) const;
113 };
114}};
115
116output decoder {{
117 Addr
118 Branch::branchTarget(Addr branchPC) const
119 {
120 return branchPC + 4 + disp;
121 }
122
123 Addr
124 Jump::branchTarget(ExecContext *xc) const
124 Jump::branchTarget(ThreadContext *tc) const
125 {
125 {
126 Addr NPC = xc->readPC() + 4;
127 uint64_t Rb = xc->readIntReg(_srcRegIdx[0]);
126 Addr NPC = tc->readPC() + 4;
127 uint64_t Rb = tc->readIntReg(_srcRegIdx[0]);
128 return (Rb & ~3) | (NPC & 1);
129 }
130
131 const std::string &
132 PCDependentDisassembly::disassemble(Addr pc,
133 const SymbolTable *symtab) const
134 {
135 if (!cachedDisassembly ||

--- 131 unchanged lines hidden ---
128 return (Rb & ~3) | (NPC & 1);
129 }
130
131 const std::string &
132 PCDependentDisassembly::disassemble(Addr pc,
133 const SymbolTable *symtab) const
134 {
135 if (!cachedDisassembly ||

--- 131 unchanged lines hidden ---