divu
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Oct 2018 22:27:24 +0000 (23:27 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Oct 2018 22:27:24 +0000 (23:27 +0100)
riscv/insns/divu.h

index 30225fbc68697511ddf6826937ec2aa1c6035e9c..ddae72d964c3a741828da03accf92cdbca5f5b48 100644 (file)
@@ -1,7 +1,7 @@
 require_extension('M');
-reg_t lhs = zext_xlen(RS1);
-reg_t rhs = zext_xlen(RS2);
-if(rhs == 0)
+sv_reg_t lhs = zext_xlen(RS1);
+sv_reg_t rhs = zext_xlen(RS2);
+if(rv_eq(rhs, sv_reg_t(0)))
   WRITE_RD(UINT64_MAX);
 else
   WRITE_RD(sext_xlen(rv_div(lhs, rhs)));