Make fpu regs work even if mstatus.fs is 0.

Change-Id: I2c283f2de226518ab9a4e0476edada51825b2993
This commit is contained in:
Tim Newsome
2016-11-01 12:58:37 -07:00
parent e7a745ed3b
commit e51b0360f5
2 changed files with 104 additions and 8 deletions
+17 -1
View File
@@ -121,15 +121,31 @@ static uint32_t fsw(unsigned int src, unsigned int base, uint16_t offset)
MATCH_FSW;
}
static uint32_t flw(unsigned int src, unsigned int base, uint16_t offset)
static uint32_t fsd(unsigned int src, unsigned int base, uint16_t offset)
{
return (bits(offset, 11, 5) << 25) |
(bits(src, 4, 0) << 20) |
(base << 15) |
(bits(offset, 4, 0) << 7) |
MATCH_FSD;
}
static uint32_t flw(unsigned int dest, unsigned int base, uint16_t offset)
{
return (bits(offset, 11, 0) << 20) |
(base << 15) |
(bits(dest, 4, 0) << 7) |
MATCH_FLW;
}
static uint32_t fld(unsigned int dest, unsigned int base, uint16_t offset)
{
return (bits(offset, 11, 0) << 20) |
(base << 15) |
(bits(dest, 4, 0) << 7) |
MATCH_FLD;
}
static uint32_t ebreak(void) { return MATCH_EBREAK; }
static uint32_t ebreak_c(void) { return MATCH_C_EBREAK; }