harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ea673424d1072dcefc15bf7536398f27efee5a94
parent 2013834e47cdf8bf375e8587229263a430359915
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Sat,  6 Feb 2021 17:02:22 -0500

Generate udiv/urem for unsigned division/modulo

Diffstat:
Msrc/qinstr.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qinstr.c b/src/qinstr.c @@ -78,13 +78,13 @@ binarithm_for_op(enum binarithm_operator op, case BIN_BAND: return Q_AND; case BIN_DIV: - return Q_DIV; + return is_signed ? Q_DIV : Q_UDIV; case BIN_MINUS: return Q_SUB; case BIN_TIMES: return Q_MUL; case BIN_MODULO: - return Q_REM; + return is_signed ? Q_REM : Q_UREM; case BIN_BOR: return Q_OR; case BIN_BXOR: