From: Taylor R Campbell Date: Mon, 14 Jan 2019 07:44:17 +0000 (+0000) Subject: Teach assembler about MODULO. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~66^2~93 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a12762e74b26d556e57b9d2c1a12424d0b67036f;p=mit-scheme.git Teach assembler about MODULO. XXX Should maybe do EUCLIDEAN-REMAINDER or the full gamut of division operators, but this is all I need for now. --- diff --git a/src/compiler/back/bitutl.scm b/src/compiler/back/bitutl.scm index 7cb117b05..433071660 100644 --- a/src/compiler/back/bitutl.scm +++ b/src/compiler/back/bitutl.scm @@ -130,7 +130,8 @@ USA. (* . ,(lambda () interval:*)) (/ . ,(lambda () interval:/)) (QUOTIENT . ,(lambda () interval:quotient)) - (REMAINDER . ,(lambda () interval:remainder)))) + (REMAINDER . ,(lambda () interval:remainder)) + (MODULO . ,(lambda () interval:modulo)))) (define-integrable (->machine-pc pc) (paranoid-quotient pc addressing-granularity)) @@ -271,6 +272,11 @@ USA. (if (or (interval? a) (interval? b)) (error "REMAINDER doesn't do intervals:" a b)) (remainder a b)) + +(define (interval:modulo a b) + (if (or (interval? a) (interval? b)) + (error "MODULO doesn't do intervals:" a b)) + (modulo a b)) ;;; A segment consists of an ending point and a coefficient. ;;; The ending point has a minimum and maximum non-negative integer value.