Skip to content

Commit

Permalink
[MIPS] Expose FCSR
Browse files Browse the repository at this point in the history
  • Loading branch information
m4xw committed Feb 23, 2024
1 parent 91e0d38 commit bbb3fa5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/remill/Arch/MIPS/Runtime/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ struct alignas(8) COP0Registers final {
Reg DESAVE;
} __attribute__((packed));

struct alignas(8) COP1Registers final {
volatile uint64_t _0;
Reg FCSR;
} __attribute__((packed));

struct alignas(8) MIPSState : public ArchState {
GPR gpr; // 528 bytes.

Expand All @@ -276,6 +281,10 @@ struct alignas(8) MIPSState : public ArchState {
COP0Registers cop0;

uint64_t _3;

COP1Registers cop1;

uint64_t _4;
} __attribute__((packed));

struct State : public MIPSState {};
Expand Down
4 changes: 4 additions & 0 deletions lib/Arch/Sleigh/MIPSArch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ class SleighMIPSArch : public ArchBase {
REG(TAGHI, cop0.TagHi.qword, u64);
REG(ERRORPC, cop0.ErrorEPC.qword, u64);
REG(DESAVE, cop0.DESAVE.qword, u64);

// COP1
// TODO: Maybe move fpr here?
REG(FCSR, cop1.FCSR.dword, u32);
}

void
Expand Down

0 comments on commit bbb3fa5

Please sign in to comment.