aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2014-12-05 01:08:27 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2014-12-05 01:08:27 -0800
commitdd8827e8b3d23d5a5289dfdfdb136ea2ef768e22 (patch)
tree042e2a7d76cd1c927392d9a284e682653258f0cc
parentd643e43dca834fcb2e40504f65d5043d9f2b018b (diff)
downloadriscv-isa-sim-dd8827e8b3d23d5a5289dfdfdb136ea2ef768e22.zip
riscv-isa-sim-dd8827e8b3d23d5a5289dfdfdb136ea2ef768e22.tar.gz
riscv-isa-sim-dd8827e8b3d23d5a5289dfdfdb136ea2ef768e22.tar.bz2
zero-extend 32b instructions for vxcptaux
-rw-r--r--hwacha/decode_hwacha.h10
-rw-r--r--hwacha/hwacha.cc2
2 files changed, 6 insertions, 6 deletions
diff --git a/hwacha/decode_hwacha.h b/hwacha/decode_hwacha.h
index 7a6c8ee..5e85bf6 100644
--- a/hwacha/decode_hwacha.h
+++ b/hwacha/decode_hwacha.h
@@ -32,14 +32,14 @@
static inline reg_t read_xpr(hwacha_t* h, insn_t insn, uint32_t idx, size_t src)
{
if (src >= h->get_ct_state()->nxpr)
- h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, insn.bits());
+ h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, uint32_t(insn.bits()));
return (h->get_ut_state(idx)->XPR[src]);
}
static inline void write_xpr(hwacha_t* h, insn_t insn, uint32_t idx, size_t dst, reg_t value)
{
if (dst >= h->get_ct_state()->nxpr)
- h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, insn.bits());
+ h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, uint32_t(insn.bits()));
h->get_ut_state(idx)->XPR.write(dst, value);
}
@@ -52,14 +52,14 @@ static inline void write_xpr(hwacha_t* h, insn_t insn, uint32_t idx, size_t dst,
static inline reg_t read_fpr(hwacha_t* h, insn_t insn, uint32_t idx, size_t src)
{
if (src >= h->get_ct_state()->nfpr)
- h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, insn.bits());
+ h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, uint32_t(insn.bits()));
return (h->get_ut_state(idx)->FPR[src]);
}
static inline void write_fpr(hwacha_t* h, insn_t insn, uint32_t idx, size_t dst, reg_t value)
{
if (dst >= h->get_ct_state()->nfpr)
- h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, insn.bits());
+ h->take_exception(HWACHA_CAUSE_TVEC_ILLEGAL_REGID, uint32_t(insn.bits()));
h->get_ut_state(idx)->FPR.write(dst, value);
}
@@ -100,6 +100,6 @@ static inline void write_fpr(hwacha_t* h, insn_t insn, uint32_t idx, size_t dst,
#define require_supervisor_hwacha \
if (unlikely(!(p->get_state()->sr & SR_S))) \
- h->take_exception(HWACHA_CAUSE_PRIVILEGED_INSTRUCTION, insn.bits());
+ h->take_exception(HWACHA_CAUSE_PRIVILEGED_INSTRUCTION, uint32_t(insn.bits()));
#endif
diff --git a/hwacha/hwacha.cc b/hwacha/hwacha.cc
index fdd215e..a56db12 100644
--- a/hwacha/hwacha.cc
+++ b/hwacha/hwacha.cc
@@ -76,7 +76,7 @@ static reg_t custom(processor_t* p, insn_t insn, reg_t pc)
}
if (!matched)
- h->take_exception(HWACHA_CAUSE_ILLEGAL_INSTRUCTION, insn.bits());
+ h->take_exception(HWACHA_CAUSE_ILLEGAL_INSTRUCTION, uint32_t(insn.bits()));
return npc;
}