aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2011-05-20 15:56:25 -0700
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2011-05-23 02:26:27 -0700
commit81a089d4ad784742adb4f13415a7fa26d9b7e504 (patch)
tree147a9ec4ba6fb94f9b7f695d49e851dbc1c86caf /pk
parent44191e8a5ef91b18e9a06c8ec9fec6e5f1f3860b (diff)
downloadpk-81a089d4ad784742adb4f13415a7fa26d9b7e504.zip
pk-81a089d4ad784742adb4f13415a7fa26d9b7e504.tar.gz
pk-81a089d4ad784742adb4f13415a7fa26d9b7e504.tar.bz2
[pk] fixed FP emulation (rounding mode bug)
Diffstat (limited to 'pk')
-rw-r--r--pk/fp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pk/fp.c b/pk/fp.c
index 794755d..e1298ad 100644
--- a/pk/fp.c
+++ b/pk/fp.c
@@ -40,7 +40,7 @@ int emulate_fp(trapframe_t* tf)
#define RRS2 ((tf->insn >> 17) & 0x1F)
#define RRS3 ((tf->insn >> 12) & 0x1F)
#define RRD ((tf->insn >> 27) & 0x1F)
- #define RM ((tf->insn >> 9) & 0x3)
+ #define RM ((tf->insn >> 9) & 0x7)
int32_t imm = ((int32_t)tf->insn << 10) >> 20;
int32_t bimm = (((tf->insn >> 27) & 0x1f) << 7) | ((tf->insn >> 10) & 0x7f);
@@ -61,7 +61,7 @@ int emulate_fp(trapframe_t* tf)
long effective_address_store = XRS1 + bimm;
softfloat_exceptionFlags = 0;
- softfloat_roundingMode = (RM & 4) ? (RM & 3) : ((fp_state.fsr >> 5) & 3);
+ softfloat_roundingMode = (RM == 7) ? ((fp_state.fsr >> 5) & 7) : RM;
#define IS_INSN(x) ((tf->insn & MASK_ ## x) == MATCH_ ## x)