* added flonum? and removed ikrt_is_flonum from the runtime system.

This commit is contained in:
Abdulaziz Ghuloum 2007-03-04 12:59:28 -05:00
parent b326fbc07a
commit c6861f41d5
6 changed files with 148 additions and 6 deletions

View File

@ -5169,3 +5169,123 @@ Words allocated: 0
Words reclaimed: 0
Elapsed time...: 554 ms (User: 553 ms; System: 1 ms)
Elapsed GC time: 0 ms (CPU: 0 in 0 collections.)
****************************
Benchmarking Larceny-r6rs on Sat Mar 3 23:18:18 EST 2007 under Darwin adsl-68-251-149-116.dsl.bltnin.ameritech.net 8.8.3 Darwin Kernel Version 8.8.3: Wed Oct 18 21:57:10 PDT 2006; root:xnu-792.15.4.obj~4/RELEASE_I386 i386 i386
Testing slatex under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 4194150
Words reclaimed: 0
Elapsed time...: 1834 ms (User: 521 ms; System: 728 ms)
Elapsed GC time: 11 ms (CPU: 10 in 16 collections.)
****************************
Benchmarking Larceny-r6rs on Sat Mar 3 23:18:39 EST 2007 under Darwin adsl-68-251-149-116.dsl.bltnin.ameritech.net 8.8.3 Darwin Kernel Version 8.8.3: Wed Oct 18 21:57:10 PDT 2006; root:xnu-792.15.4.obj~4/RELEASE_I386 i386 i386
Testing slatex under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 4194150
Words reclaimed: 0
Elapsed time...: 2042 ms (User: 534 ms; System: 749 ms)
Elapsed GC time: 8 ms (CPU: 12 in 16 collections.)
****************************
Benchmarking Larceny-r6rs on Sat Mar 3 23:19:41 EST 2007 under Darwin adsl-68-251-149-116.dsl.bltnin.ameritech.net 8.8.3 Darwin Kernel Version 8.8.3: Wed Oct 18 21:57:10 PDT 2006; root:xnu-792.15.4.obj~4/RELEASE_I386 i386 i386
Testing wc under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 0
Words reclaimed: 0
Elapsed time...: 293 ms (User: 248 ms; System: 45 ms)
Elapsed GC time: 0 ms (CPU: 0 in 0 collections.)
****************************
Benchmarking Larceny-r6rs on Sat Mar 3 23:21:27 EST 2007 under Darwin adsl-68-251-149-116.dsl.bltnin.ameritech.net 8.8.3 Darwin Kernel Version 8.8.3: Wed Oct 18 21:57:10 PDT 2006; root:xnu-792.15.4.obj~4/RELEASE_I386 i386 i386
Testing fib under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 0
Words reclaimed: 0
Elapsed time...: 1786 ms (User: 1783 ms; System: 2 ms)
Elapsed GC time: 0 ms (CPU: 0 in 0 collections.)
****************************
Benchmarking Larceny-r6rs on Sat Mar 3 23:21:47 EST 2007 under Darwin adsl-68-251-149-116.dsl.bltnin.ameritech.net 8.8.3 Darwin Kernel Version 8.8.3: Wed Oct 18 21:57:10 PDT 2006; root:xnu-792.15.4.obj~4/RELEASE_I386 i386 i386
Testing sum under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 0
Words reclaimed: 0
Elapsed time...: 555 ms (User: 553 ms; System: 2 ms)
Elapsed GC time: 0 ms (CPU: 0 in 0 collections.)
****************************
Benchmarking Larceny-r6rs on Sat Mar 3 23:32:17 EST 2007 under Darwin adsl-68-251-149-116.dsl.bltnin.ameritech.net 8.8.3 Darwin Kernel Version 8.8.3: Wed Oct 18 21:57:10 PDT 2006; root:xnu-792.15.4.obj~4/RELEASE_I386 i386 i386
Testing cat under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 0
Words reclaimed: 0
Elapsed time...: 500 ms (User: 373 ms; System: 126 ms)
Elapsed GC time: 0 ms (CPU: 0 in 0 collections.)

Binary file not shown.

View File

@ -6,6 +6,7 @@
#include <math.h>
#if 0
ikp
ikrt_is_flonum(ikp x){
if(tagof(x) == vector_tag){
@ -15,6 +16,7 @@ ikrt_is_flonum(ikp x){
}
return false_object;
}
#endif
ikp
ikrt_string_to_flonum(ikp x, ikpcb* pcb){

Binary file not shown.

View File

@ -56,6 +56,8 @@
[$pcb-set! 2 effect]
;;; type predicates
[fixnum? 1 pred]
[bignum? 1 pred]
[flonum? 1 pred]
[immediate? 1 pred]
[boolean? 1 pred]
[char? 1 pred]
@ -2031,7 +2033,7 @@
(and (fixnum? n) (fx<= 0 n) (fx<= n 127)))
(define (valid-arg-types? op rand*)
(case op
[(fixnum? immediate? boolean? char? vector? string? procedure?
[(fixnum? flonum? bignum? immediate? boolean? char? vector? string? procedure?
null? pair? not cons eq? vector symbol? error eof-object eof-object?
void $unbound-object? $code? $forward-ptr? bwp-object?
pointer-value top-level-value car cdr list* list $record
@ -3037,6 +3039,18 @@
(define disp-car 0)
(define disp-cdr 4)
(define pair-size 8)
(define flonum-tag #x17)
(define flonum-size 16)
(define disp-flonum-data 8)
(define bignum-mask #b111)
(define bignum-tag #b011)
(define bignum-sign-mask #b1000)
(define bignum-sign-shift 3)
(define bignum-length-shift 4)
(define disp-bignum-data 4)
(define pagesize 4096)
(define pageshift 12)
(define wordsize 4)
@ -3348,6 +3362,12 @@
[(port?)
(indirect-type-pred
vector-mask vector-tag port-mask port-tag rand* Lt Lf ac)]
[(bignum?)
(indirect-type-pred
vector-mask vector-tag bignum-mask bignum-tag rand* Lt Lf ac)]
[(flonum?)
(indirect-type-pred
vector-mask vector-tag #f flonum-tag rand* Lt Lf ac)]
[($record/rtd?)
(cond
[Lf
@ -4080,7 +4100,8 @@
$set-port-output-index! $set-port-output-size!)
(do-effect-prim op arg*
(cons (movl (int void-object) eax) ac))]
[(fixnum? immediate? $fxzero? boolean? char? pair? vector? string? symbol?
[(fixnum? bignum? flonum? immediate? $fxzero? boolean? char? pair?
vector? string? symbol?
procedure? null? not eof-object? $fx= $fx< $fx<= $fx> $fx>= eq?
$char= $char< $char<= $char> $char>= $unbound-object? $code?
$record? $record/rtd? bwp-object? port? input-port? output-port?)

View File

@ -1,7 +1,5 @@
(let ()
(define (flonum? x)
(foreign-call "ikrt_is_flonum" x))
(define (flonum->string x)
(or (foreign-call "ikrt_flonum_to_string" x)
(error 'flonum->string "~s is not a flonum" x)))
@ -11,7 +9,8 @@
[else
(error 'string->flonum "~s is not a string" x)]))
(primitive-set! 'flonum? flonum?)
(primitive-set! 'flonum?
(lambda (x) (flonum? x)))
(primitive-set! 'flonum->string flonum->string)
(primitive-set! 'string->flonum string->flonum)
)
@ -819,5 +818,5 @@
(primitive-set! 'integer? integer?)
(primitive-set! 'exact->inexact exact->inexact)
(primitive-set! 'modulo modulo)
(primitive-set! 'bignum? bignum?)
)