* Added fixnum-width, least-fixnum, greatest-fixnum
This commit is contained in:
parent
82a00e2628
commit
96bd57c922
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -1,15 +1,20 @@
|
||||||
|
|
||||||
(library (ikarus singular-objects)
|
(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
|
(import
|
||||||
(rename (ikarus system $records) (base-rtd sys:base-rtd))
|
(rename (ikarus system $records) (base-rtd sys:base-rtd))
|
||||||
(rename (ikarus)
|
(rename (ikarus)
|
||||||
(void sys:void)
|
(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)))
|
(eof-object sys:eof-object)))
|
||||||
|
|
||||||
(define (void) (sys:void))
|
(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 (eof-object) (sys:eof-object))
|
||||||
(define (base-rtd) (sys:base-rtd)))
|
(define (base-rtd) (sys:base-rtd)))
|
||||||
|
|
||||||
|
|
|
@ -459,7 +459,9 @@
|
||||||
[fxarithmetic-shift i]
|
[fxarithmetic-shift i]
|
||||||
[fxmin i]
|
[fxmin i]
|
||||||
[fxmax i]
|
[fxmax i]
|
||||||
[fixnum-width i]
|
[fixnum-width i]
|
||||||
|
[least-fixnum i]
|
||||||
|
[greatest-fixnum i]
|
||||||
|
|
||||||
[for-each i r]
|
[for-each i r]
|
||||||
[map i r]
|
[map i r]
|
||||||
|
|
|
@ -545,14 +545,26 @@
|
||||||
[(P x) (tag-test (T x) fixnum-mask fixnum-tag)]
|
[(P x) (tag-test (T x) fixnum-mask fixnum-tag)]
|
||||||
[(E x) (nop)])
|
[(E x) (nop)])
|
||||||
|
|
||||||
;(define-primop foo safe
|
|
||||||
; [(V) (K 0)])
|
|
||||||
|
|
||||||
;(define-primop fixnum-width safe
|
(define-primop fixnum-width safe
|
||||||
; [(V) (K 0)] ;(K (fxsll (- (* wordsize 8) fx-shift) fx-shift))]
|
[(V) (K (fxsll (- (* wordsize 8) fx-shift) fx-shift))]
|
||||||
; ;[(E) (nop)]
|
[(E) (nop)]
|
||||||
; ;[(P) (K #t)]
|
[(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
|
(define-primop $fxzero? unsafe
|
||||||
[(P x) (prm '= (T x) (K 0))]
|
[(P x) (prm '= (T x) (K 0))]
|
||||||
|
|
|
@ -257,6 +257,9 @@
|
||||||
[bitwise-rotate-bit-field D bw]
|
[bitwise-rotate-bit-field D bw]
|
||||||
;;;
|
;;;
|
||||||
[fixnum? C fx]
|
[fixnum? C fx]
|
||||||
|
[fixnum-width C fx]
|
||||||
|
[least-fixnum C fx]
|
||||||
|
[greatest-fixnum C fx]
|
||||||
[fx* C fx]
|
[fx* C fx]
|
||||||
[fx*/carry D fx]
|
[fx*/carry D fx]
|
||||||
[fx+ C fx]
|
[fx+ C fx]
|
||||||
|
|
Loading…
Reference in New Issue