zero-extend 32b instructions for vxcptaux
authorAndrew Waterman <waterman@cs.berkeley.edu>
Fri, 5 Dec 2014 09:08:27 +0000 (01:08 -0800)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Fri, 5 Dec 2014 09:08:27 +0000 (01:08 -0800)
hwacha/decode_hwacha.h
hwacha/hwacha.cc

index 7a6c8ee05e3c724cfc96a31e2b4287df7003afb1..5e85bf6b5d17a0a1a1cc5890b4de935f58f7c348 100644 (file)
 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
index fdd215eb1d884e00db8dff4d9f25cdfa1b172457..a56db12409f127640a80a5f468d4051871799b9a 100644 (file)
@@ -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;
 }