ROSE
0.9.6a
|
Describes (part of) a physical CPU register. More...
#include <Cxx_Grammar.h>
Public Member Functions | |
RegisterDescriptor () | |
RegisterDescriptor (unsigned majr, unsigned minr, unsigned offset, unsigned nbits) | |
unsigned | get_major () const |
bool | is_valid () const |
RegisterDescriptor & | set_major (unsigned majr) |
unsigned | get_minor () const |
RegisterDescriptor & | set_minor (unsigned minr) |
unsigned | get_offset () const |
RegisterDescriptor & | set_offset (unsigned offset) |
unsigned | get_nbits () const |
RegisterDescriptor & | set_nbits (unsigned nbits) |
bool | operator< (const RegisterDescriptor &other) const |
bool | operator== (const RegisterDescriptor &other) const |
bool | operator!= (const RegisterDescriptor &other) const |
void | print (std::ostream &o) const |
Private Attributes | |
unsigned | majr |
unsigned | minr |
Major type of register, such as integer, floating point, flag, etc. More... | |
unsigned | offset |
Register number within major division. More... | |
unsigned | nbits |
Low-bit offset within the physical register. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &, const RegisterDescriptor &) |
Describes (part of) a physical CPU register.
Some architectures have multiple names for physical registers. For example, a amd64 has a 64-bit integer register, parts of which are referred to as "rax", "eax", "ax", "al", and "ah". The purpose of a RegisterDescriptor is to describe what physical register (major and minor) is being referenced, and the part (offset and nbits) that's being referenced.
The reason for having a major and minor number to specify a register is to allow for different types of registers. For instance, an i686 has a set of 64-bit integer registers and a set of 80-bit floating point registers (among others). Having major and minor numbers allows the physical register set (such as defined by an instruction semantics policy) to be implemented as an array of 64-bit integers and an array of 80-bit floating points (among others). The array is selected by the major number while the element of the array is selected by the minor number.
The RegisterDescriptor type is part of a SgAsmRegisterReferenceExpression and also appears in the register dictionaries (RegisterDictionary) used in various places including the disassembler.
Definition at line 6419 of file Cxx_Grammar.h.
|
inline |
Definition at line 6421 of file Cxx_Grammar.h.
|
inline |
Definition at line 6423 of file Cxx_Grammar.h.
|
inline |
Definition at line 6425 of file Cxx_Grammar.h.
References majr.
Referenced by RegisterDictionary::filter_nonoverlapping(), Partitioner::get_indirection_addr(), RegisterDictionary::hash(), SgAsmMipsInstruction::is_function_return(), modifies_ip(), RegisterNames::operator()(), and Partitioner::pattern1().
|
inline |
Definition at line 6428 of file Cxx_Grammar.h.
References nbits.
|
inline |
Definition at line 6431 of file Cxx_Grammar.h.
References majr.
|
inline |
Definition at line 6435 of file Cxx_Grammar.h.
References minr.
Referenced by RegisterDictionary::filter_nonoverlapping(), RegisterDictionary::hash(), SgAsmMipsInstruction::is_function_return(), modifies_ip(), RegisterNames::operator()(), and Partitioner::pattern1().
|
inline |
Definition at line 6438 of file Cxx_Grammar.h.
References minr.
|
inline |
Definition at line 6442 of file Cxx_Grammar.h.
References offset.
Referenced by RegisterDictionary::filter_nonoverlapping(), RegisterDictionary::hash(), and RegisterNames::operator()().
|
inline |
Definition at line 6445 of file Cxx_Grammar.h.
References offset.
|
inline |
Definition at line 6449 of file Cxx_Grammar.h.
References nbits.
Referenced by RegisterDictionary::filter_nonoverlapping(), RegisterDictionary::hash(), RegisterDictionary::SortBySize::operator()(), and RegisterNames::operator()().
|
inline |
Definition at line 6452 of file Cxx_Grammar.h.
References nbits.
Referenced by RegisterDictionary::resize().
bool RegisterDescriptor::operator< | ( | const RegisterDescriptor & | other) | const |
bool RegisterDescriptor::operator== | ( | const RegisterDescriptor & | other) | const |
bool RegisterDescriptor::operator!= | ( | const RegisterDescriptor & | other) | const |
Definition at line 30 of file Registers.C.
|
inline |
Definition at line 6459 of file Cxx_Grammar.h.
References majr, minr, nbits, and offset.
Referenced by operator<<().
|
friend |
Definition at line 12 of file Registers.C.
|
private |
Definition at line 6465 of file Cxx_Grammar.h.
Referenced by get_major(), operator<(), operator==(), print(), and set_major().
|
private |
Major type of register, such as integer, floating point, flag, etc.
Definition at line 6466 of file Cxx_Grammar.h.
Referenced by get_minor(), operator<(), operator==(), print(), and set_minor().
|
private |
Register number within major division.
Definition at line 6467 of file Cxx_Grammar.h.
Referenced by get_offset(), operator<(), operator==(), print(), and set_offset().
|
private |
Low-bit offset within the physical register.
Definition at line 6468 of file Cxx_Grammar.h.
Referenced by get_nbits(), is_valid(), operator<(), operator==(), print(), and set_nbits().