aboutsummaryrefslogtreecommitdiff
path: root/riscv/decode.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-11-09 15:31:00 -0800
committerAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-11-21 16:54:35 -0800
commit259d20a35dde46c51878dfd3afb7b8c518ed3dcf (patch)
tree7f6f457829f456f7d552e3c4fceb7f14830481d5 /riscv/decode.h
parent6d443095f92d8ff5d7c9831e1e111ef605d637f0 (diff)
downloadspike-259d20a35dde46c51878dfd3afb7b8c518ed3dcf.zip
spike-259d20a35dde46c51878dfd3afb7b8c518ed3dcf.tar.gz
spike-259d20a35dde46c51878dfd3afb7b8c518ed3dcf.tar.bz2
[opcodes, pk, sim, xcc] Tweaked FP encoding
Diffstat (limited to 'riscv/decode.h')
-rw-r--r--riscv/decode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/riscv/decode.h b/riscv/decode.h
index 327da6c..903eef5 100644
--- a/riscv/decode.h
+++ b/riscv/decode.h
@@ -185,7 +185,8 @@ private:
#define TARGET insn.jtype.target
#define BRANCH_TARGET (npc + (BIMM << BRANCH_ALIGN_BITS))
#define JUMP_TARGET (npc + (TARGET << JUMP_ALIGN_BITS))
-#define RM (insn.ftype.ffunct & 3)
+#define RM ((insn.ftype.ffunct & 4) ? (insn.ftype.ffunct & 3) : \
+ ((fsr & FSR_RD) >> FSR_RD_SHIFT))
#define require_supervisor if(!(sr & SR_S)) throw trap_privileged_instruction
#define require64 if(gprlen != 64) throw trap_illegal_instruction