diff --git a/src/ikarus.boot b/src/ikarus.boot index b0a1af2..bfce399 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.singular-objects.ss b/src/ikarus.singular-objects.ss index 01890da..15ae05f 100644 --- a/src/ikarus.singular-objects.ss +++ b/src/ikarus.singular-objects.ss @@ -1,15 +1,20 @@ (library (ikarus singular-objects) - (export base-rtd eof-object void #;fixnum-width) + (export base-rtd eof-object void fixnum-width least-fixnum + greatest-fixnum) (import (rename (ikarus system $records) (base-rtd sys:base-rtd)) (rename (ikarus) (void sys:void) - #; (fixnum-width sys:fixnum-width) + (fixnum-width sys:fixnum-width) + (least-fixnum sys:least-fixnum) + (greatest-fixnum sys:greatest-fixnum) (eof-object sys:eof-object))) (define (void) (sys:void)) -#; (define (fixnum-width) (sys:fixnum-width)) + (define (fixnum-width) (sys:fixnum-width)) + (define (least-fixnum) (sys:least-fixnum)) + (define (greatest-fixnum) (sys:greatest-fixnum)) (define (eof-object) (sys:eof-object)) (define (base-rtd) (sys:base-rtd))) diff --git a/src/makefile.ss b/src/makefile.ss index 2cc1f32..ee2b39b 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -459,7 +459,9 @@ [fxarithmetic-shift i] [fxmin i] [fxmax i] - [fixnum-width i] + [fixnum-width i] + [least-fixnum i] + [greatest-fixnum i] [for-each i r] [map i r] diff --git a/src/pass-specify-rep-primops.ss b/src/pass-specify-rep-primops.ss index 85d4125..2150792 100644 --- a/src/pass-specify-rep-primops.ss +++ b/src/pass-specify-rep-primops.ss @@ -545,14 +545,26 @@ [(P x) (tag-test (T x) fixnum-mask fixnum-tag)] [(E x) (nop)]) -;(define-primop foo safe -; [(V) (K 0)]) -;(define-primop fixnum-width safe -; [(V) (K 0)] ;(K (fxsll (- (* wordsize 8) fx-shift) fx-shift))] -; ;[(E) (nop)] -; ;[(P) (K #t)] -; ) +(define-primop fixnum-width safe + [(V) (K (fxsll (- (* wordsize 8) fx-shift) fx-shift))] + [(E) (nop)] + [(P) (K #t)]) + +(define-primop least-fixnum safe + [(V) (K (sll (- (expt 2 (- (- (* wordsize 8) fx-shift) 1))) + fx-shift))] + [(E) (nop)] + [(P) (K #t)]) + +(define-primop greatest-fixnum safe + [(V) (K (sll (- (expt 2 (- (- (* wordsize 8) fx-shift) 1)) 1) + fx-shift))] + [(E) (nop)] + [(P) (K #t)]) + + + (define-primop $fxzero? unsafe [(P x) (prm '= (T x) (K 0))] diff --git a/src/todo-r6rs.ss b/src/todo-r6rs.ss index a9f97b5..4d0d32c 100755 --- a/src/todo-r6rs.ss +++ b/src/todo-r6rs.ss @@ -257,6 +257,9 @@ [bitwise-rotate-bit-field D bw] ;;; [fixnum? C fx] + [fixnum-width C fx] + [least-fixnum C fx] + [greatest-fixnum C fx] [fx* C fx] [fx*/carry D fx] [fx+ C fx]