fixed a bug in remu[w]
authorAndrew Waterman <waterman@eecs.berkeley.edu>
Mon, 20 Feb 2012 07:18:58 +0000 (23:18 -0800)
committerAndrew Waterman <waterman@eecs.berkeley.edu>
Mon, 20 Feb 2012 07:18:58 +0000 (23:18 -0800)
it was actually caught by the ASM tests... :(

riscv/insns/remu.h
riscv/insns/remuw.h

index ca66318fea0ecd05ba73ef89c6530a1b4b044b83..1057789e80633bf1eea7cd2a29adc8607af9bdda 100644 (file)
@@ -1,6 +1,6 @@
 reg_t lhs = zext_xprlen(RS1);
 reg_t rhs = zext_xprlen(RS2);
 if(rhs == 0)
-  RD = lhs;
+  RD = sext_xprlen(RS1);
 else
   RD = sext_xprlen(lhs % rhs);
index aac13fbf1defa03563f13f37724cceff050bb013..1ef810ceae22cfd4530a3c3a0078732fc352bb2f 100644 (file)
@@ -2,6 +2,6 @@ require_xpr64;
 reg_t lhs = zext32(RS1);
 reg_t rhs = zext32(RS2);
 if(rhs == 0)
-  RD = lhs;
+  RD = sext32(lhs);
 else
   RD = sext32(lhs % rhs);