readsR* functions

This commit is contained in:
angie 2022-12-14 18:03:13 -03:00
parent bd47bc6bc2
commit 77dda82424
6 changed files with 50 additions and 0 deletions

View File

@ -223,6 +223,10 @@ namespace rabbitizer {
bool modifiesRt() const;
bool modifiesRd() const;
bool readsRs() const;
bool readsRt() const;
bool readsRd() const;
bool readsHI() const;
bool readsLO() const;
bool modifiesHI() const;

View File

@ -846,6 +846,16 @@ bool InstructionBase::modifiesRd() const {
return RabbitizerInstrDescriptor_modifiesRd(this->instr.descriptor);
}
bool InstructionBase::readsRs() const {
return RabbitizerInstrDescriptor_readsRs(this->instr.descriptor);
}
bool InstructionBase::readsRt() const {
return RabbitizerInstrDescriptor_readsRt(this->instr.descriptor);
}
bool InstructionBase::readsRd() const {
return RabbitizerInstrDescriptor_readsRd(this->instr.descriptor);
}
bool InstructionBase::readsHI() const {
return RabbitizerInstrDescriptor_readsHI(this->instr.descriptor);
}

View File

@ -76,6 +76,19 @@ typedef struct RabbitizerInstrDescriptor {
*/
bool modifiesRd;
/**
* The instruction reads the value which the MIPS `rs` register holds
*/
bool readsRs;
/**
* The instruction reads the value which the MIPS `rt` register holds
*/
bool readsRt;
/**
* The instruction reads the value which the MIPS `rd` register holds
*/
bool readsRd;
bool readsHI;
bool readsLO;
bool modifiesHI;
@ -169,6 +182,13 @@ bool RabbitizerInstrDescriptor_modifiesRt(const RabbitizerInstrDescriptor *self)
NODISCARD NON_NULL(1) PURE
bool RabbitizerInstrDescriptor_modifiesRd(const RabbitizerInstrDescriptor *self);
NODISCARD NON_NULL(1) PURE
bool RabbitizerInstrDescriptor_readsRs(const RabbitizerInstrDescriptor *self);
NODISCARD NON_NULL(1) PURE
bool RabbitizerInstrDescriptor_readsRt(const RabbitizerInstrDescriptor *self);
NODISCARD NON_NULL(1) PURE
bool RabbitizerInstrDescriptor_readsRd(const RabbitizerInstrDescriptor *self);
NODISCARD NON_NULL(1) PURE
bool RabbitizerInstrDescriptor_readsHI(const RabbitizerInstrDescriptor *self);
NODISCARD NON_NULL(1) PURE

View File

@ -94,6 +94,9 @@ class Instruction:
def isUnsigned(self) -> bool: ...
def modifiesRt(self) -> bool: ...
def modifiesRd(self) -> bool: ...
def readsRs(self) -> bool: ...
def readsRt(self) -> bool: ...
def readsRd(self) -> bool: ...
def readsHI(self) -> bool: ...
def readsLO(self) -> bool: ...
def modifiesHI(self) -> bool: ...

View File

@ -353,6 +353,9 @@ DEF_DESCRIPTOR_METHOD_BOOL(isDouble)
DEF_DESCRIPTOR_METHOD_BOOL(isUnsigned)
DEF_DESCRIPTOR_METHOD_BOOL(modifiesRt)
DEF_DESCRIPTOR_METHOD_BOOL(modifiesRd)
DEF_DESCRIPTOR_METHOD_BOOL(readsRs)
DEF_DESCRIPTOR_METHOD_BOOL(readsRt)
DEF_DESCRIPTOR_METHOD_BOOL(readsRd)
DEF_DESCRIPTOR_METHOD_BOOL(readsHI)
DEF_DESCRIPTOR_METHOD_BOOL(readsLO)
DEF_DESCRIPTOR_METHOD_BOOL(modifiesHI)

View File

@ -72,6 +72,16 @@ bool RabbitizerInstrDescriptor_modifiesRd(const RabbitizerInstrDescriptor *self)
return self->modifiesRd;
}
bool RabbitizerInstrDescriptor_readsRs(const RabbitizerInstrDescriptor *self) {
return self->readsRs;
}
bool RabbitizerInstrDescriptor_readsRt(const RabbitizerInstrDescriptor *self) {
return self->readsRt;
}
bool RabbitizerInstrDescriptor_readsRd(const RabbitizerInstrDescriptor *self) {
return self->readsRd;
}
bool RabbitizerInstrDescriptor_readsHI(const RabbitizerInstrDescriptor *self) {
return self->readsHI;
}