branch.hh (6253:988a001820f8) | branch.hh (7099:1949ba4db2cf) |
---|---|
1/* Copyright (c) 2007-2008 The Florida State University 2 * All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 38 unchanged lines hidden (view full) --- 47 protected: 48 /// Cached program counter from last disassembly 49 mutable Addr cachedPC; 50 51 /// Cached symbol table pointer from last disassembly 52 mutable const SymbolTable *cachedSymtab; 53 54 /// Constructor | 1/* Copyright (c) 2007-2008 The Florida State University 2 * All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 38 unchanged lines hidden (view full) --- 47 protected: 48 /// Cached program counter from last disassembly 49 mutable Addr cachedPC; 50 51 /// Cached symbol table pointer from last disassembly 52 mutable const SymbolTable *cachedSymtab; 53 54 /// Constructor |
55 PCDependentDisassembly(const char *mnem, MachInst _machInst, | 55 PCDependentDisassembly(const char *mnem, ExtMachInst _machInst, |
56 OpClass __opClass) 57 : PredOp(mnem, _machInst, __opClass), 58 cachedPC(0), cachedSymtab(0) 59 { 60 } 61 62 const std::string & 63 disassemble(Addr pc, const SymbolTable *symtab) const; --- 5 unchanged lines hidden (view full) --- 69 */ 70class Branch : public PCDependentDisassembly 71{ 72 protected: 73 /// target address (signed) Displacement . 74 int32_t disp; 75 76 /// Constructor. | 56 OpClass __opClass) 57 : PredOp(mnem, _machInst, __opClass), 58 cachedPC(0), cachedSymtab(0) 59 { 60 } 61 62 const std::string & 63 disassemble(Addr pc, const SymbolTable *symtab) const; --- 5 unchanged lines hidden (view full) --- 69 */ 70class Branch : public PCDependentDisassembly 71{ 72 protected: 73 /// target address (signed) Displacement . 74 int32_t disp; 75 76 /// Constructor. |
77 Branch(const char *mnem, MachInst _machInst, OpClass __opClass) | 77 Branch(const char *mnem, ExtMachInst _machInst, OpClass __opClass) |
78 : PCDependentDisassembly(mnem, _machInst, __opClass), 79 disp(machInst.offset << 2) 80 { 81 //If Bit 26 is 1 then Sign Extend 82 if ( (disp & 0x02000000) > 0 ) { 83 disp |= 0xFC000000; 84 } 85 } --- 6 unchanged lines hidden (view full) --- 92 93/** 94 * Base class for branch and exchange instructions on the ARM 95 */ 96class BranchExchange : public PredOp 97{ 98 protected: 99 /// Constructor | 78 : PCDependentDisassembly(mnem, _machInst, __opClass), 79 disp(machInst.offset << 2) 80 { 81 //If Bit 26 is 1 then Sign Extend 82 if ( (disp & 0x02000000) > 0 ) { 83 disp |= 0xFC000000; 84 } 85 } --- 6 unchanged lines hidden (view full) --- 92 93/** 94 * Base class for branch and exchange instructions on the ARM 95 */ 96class BranchExchange : public PredOp 97{ 98 protected: 99 /// Constructor |
100 BranchExchange(const char *mnem, MachInst _machInst, | 100 BranchExchange(const char *mnem, ExtMachInst _machInst, |
101 OpClass __opClass) 102 : PredOp(mnem, _machInst, __opClass) 103 { 104 } 105 106 std::string 107 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 108}; --- 9 unchanged lines hidden (view full) --- 118 119 /// Displacement to target address (signed). 120 int32_t disp; 121 122 uint32_t target; 123 124 public: 125 /// Constructor | 101 OpClass __opClass) 102 : PredOp(mnem, _machInst, __opClass) 103 { 104 } 105 106 std::string 107 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 108}; --- 9 unchanged lines hidden (view full) --- 118 119 /// Displacement to target address (signed). 120 int32_t disp; 121 122 uint32_t target; 123 124 public: 125 /// Constructor |
126 Jump(const char *mnem, MachInst _machInst, OpClass __opClass) | 126 Jump(const char *mnem, ExtMachInst _machInst, OpClass __opClass) |
127 : PCDependentDisassembly(mnem, _machInst, __opClass), 128 disp(machInst.offset << 2) 129 { 130 } 131 132 Addr branchTarget(ThreadContext *tc) const; 133 134 std::string 135 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 136}; 137} 138 139#endif //__ARCH_ARM_INSTS_BRANCH_HH__ | 127 : PCDependentDisassembly(mnem, _machInst, __opClass), 128 disp(machInst.offset << 2) 129 { 130 } 131 132 Addr branchTarget(ThreadContext *tc) const; 133 134 std::string 135 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 136}; 137} 138 139#endif //__ARCH_ARM_INSTS_BRANCH_HH__ |