-
-
Save sorear/2994acbe327d8741ea0ad892c2619de9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c | |
index 8912fea..08af864 100644 | |
--- a/target/riscv/op_helper.c | |
+++ b/target/riscv/op_helper.c | |
@@ -133,6 +133,7 @@ void csr_write_helper(CPURISCVState *env, target_ulong val_to_write, | |
MSTATUS_MPP | MSTATUS_MXR; | |
} | |
mstatus = (mstatus & ~mask) | (val_to_write & mask); | |
+ if (mstatus & MSTATUS_FS) mstatus |= MSTATUS_FS; /* FP is always dirty if enabled */ | |
int dirty = (mstatus & MSTATUS_FS) == MSTATUS_FS; | |
dirty |= (mstatus & MSTATUS_XS) == MSTATUS_XS; | |
mstatus = set_field(mstatus, MSTATUS_SD, dirty); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment