From: Andrew Waterman Date: Fri, 5 Dec 2014 09:08:27 +0000 (-0800) Subject: zero-extend 32b instructions for vxcptaux X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd8827e8b3d23d5a5289dfdfdb136ea2ef768e22;p=riscv-isa-sim.git zero-extend 32b instructions for vxcptaux --- 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; }