diff --git a/scheme/ikarus.boot.prebuilt b/scheme/ikarus.boot.prebuilt index 396601f..49b2670 100644 Binary files a/scheme/ikarus.boot.prebuilt and b/scheme/ikarus.boot.prebuilt differ diff --git a/scheme/ikarus.fixnums.ss b/scheme/ikarus.fixnums.ss index ff39c35..feb7cec 100644 --- a/scheme/ikarus.fixnums.ss +++ b/scheme/ikarus.fixnums.ss @@ -26,13 +26,13 @@ fixnum->string fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift fxmin fxmax - error@fx+ error@fx*) + error@fx+ error@fx* error@fx-) (import (ikarus system $fx) (ikarus system $chars) (ikarus system $pairs) (ikarus system $strings) - (prefix (only (ikarus) fx+ fx*) sys:) + (prefix (only (ikarus) fx+ fx* fx-) sys:) (except (ikarus) fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx* fxquotient fxremainder fxmodulo fxlogor fxlogand fxlogxor fxsll fxsra fx= fx< fx<= fx> fx>= @@ -76,38 +76,29 @@ (die 'fxnot "not a fixnum" x)) ($fxlognot x))) - - (define error@fx+ + (define (make-fx-error who msg) (lambda (x y) (if (fixnum? x) (if (fixnum? y) - (die 'fx+ "overflow when adding numbers" x y) - (die 'fx+ "not a fixnum" y)) - (die 'fx+ "not a fixnum" x)))) + (die who msg x y) + (die who "not a fixnum" y)) + (die who "not a fixnum" x)))) + + (define error@fx+ + (make-fx-error 'fx+ "overflow when adding numbers")) + + (define error@fx- + (make-fx-error 'fx- "overflow when subtracting numbers")) (define error@fx* - (lambda (x y) - (if (fixnum? x) - (if (fixnum? y) - (die 'fx* "overflow when multiplying numbers" x y) - (die 'fx* "not a fixnum" y)) - (die 'fx* "not a fixnum" x)))) + (make-fx-error 'fx* "overflow when multiplying numbers")) - (define fx+ - (lambda (x y) - (sys:fx+ x y))) + (define (fx+ x y) (sys:fx+ x y)) - (define fx- - (lambda (x y) - (unless (fixnum? x) - (die 'fx- "not a fixnum" x)) - (unless (fixnum? y) - (die 'fx- "not a fixnum" y)) - ($fx- x y))) + (define (fx* x y) (sys:fx* x y)) + + (define (fx- x y) (sys:fx- x y)) - (define fx* - (lambda (x y) - (sys:fx* x y))) (define false-loop diff --git a/scheme/last-revision b/scheme/last-revision index e4f0a85..a3d3785 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1379 +1380 diff --git a/scheme/makefile.ss b/scheme/makefile.ss index 4c24544..9f5139d 100755 --- a/scheme/makefile.ss +++ b/scheme/makefile.ss @@ -566,6 +566,7 @@ [make-traced-procedure i] [error@fx+ ] [error@fx* ] + [error@fx- ] [fasl-write i] [lambda i r ba se ne] [and i r ba se ne] diff --git a/scheme/pass-specify-rep-primops.ss b/scheme/pass-specify-rep-primops.ss index 794412d..36e417f 100644 --- a/scheme/pass-specify-rep-primops.ss +++ b/scheme/pass-specify-rep-primops.ss @@ -1247,6 +1247,8 @@ (define-primop fx+ safe [(V x y) (cogen-value-+ x y)]) +(define-primop fx- safe + [(V x y) (cogen-value-- x y)]) (define-primop fx* safe [(V a b) diff --git a/scheme/pass-specify-rep.ss b/scheme/pass-specify-rep.ss index ead91b1..1cb4ff0 100644 --- a/scheme/pass-specify-rep.ss +++ b/scheme/pass-specify-rep.ss @@ -56,6 +56,7 @@ (define (primop-interrupt-handler x) (case x [(fx+) 'error@fx+] + [(fx-) 'error@fx-] [(fx*) 'error@fx*] [else x])) (define (make-interrupt-call op args)