Added bitwise-and primop.

This commit is contained in:
Abdulaziz Ghuloum 2008-01-19 15:44:38 -05:00
parent dd5967c433
commit 48100f3737
8 changed files with 5426 additions and 12 deletions

View File

@ -68,6 +68,6 @@ EXTRA_DIST=README bench.ss benchall.ss rn100 parsing-data.ss \
benchall:
date +"NOW: %Y-%m-%d %H:%M:%S" >>timelog
../src/ikarus -b ../scheme/ikarus.boot --r6rs-script benchall.ss >>timelog
../src/ikarus -b ../scheme/ikarus.boot --r6rs-script benchall.ss 2>>timelog
rm -f z*.scm z*.tex

View File

@ -373,7 +373,7 @@ uninstall-am:
benchall:
date +"NOW: %Y-%m-%d %H:%M:%S" >>timelog
../src/ikarus -b ../scheme/ikarus.boot --r6rs-script benchall.ss >>timelog
../src/ikarus -b ../scheme/ikarus.boot --r6rs-script benchall.ss 2>>timelog
rm -f z*.scm z*.tex
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,4 +1,4 @@
#!/usr/bin/env ikarus --r6rs-script
#!../src/ikarus -b ../scheme/ikarus.boot --r6rs-script
(import (ikarus))
@ -10,6 +10,7 @@
(list 'rnrs-benchmarks name)))))])
(proc)))
(verbose-timer #t)
(apply
(case-lambda
[(script-name bench-name)

View File

@ -2,14 +2,17 @@
(import (ikarus))
;(define all-benchmarks
; '(ack array1 bibfreq boyer browse cat compiler conform cpstak ctak dderiv
; deriv destruc diviter divrec dynamic earley fft fib fibc fibfp
; fpsum gcbench gcold graphs lattice matrix maze mazefun mbrot
; nbody nboyer nqueens ntakl nucleic paraffins parsing perm9 peval
; pi pnpoly primes puzzle quicksort ray sboyer scheme simplex
; slatex string sum sum1 sumfp sumloop tail tak takl trav1 trav2
; triangl wc))
(define all-benchmarks
'(ack array1 bibfreq boyer browse cat compiler conform cpstak ctak dderiv
deriv destruc diviter divrec dynamic earley fft fib fibc fibfp
fpsum gcbench gcold graphs lattice matrix maze mazefun mbrot
nbody nboyer nqueens ntakl nucleic paraffins parsing perm9 peval
pi pnpoly primes puzzle quicksort ray sboyer scheme simplex
slatex string sum sum1 sumfp sumloop tail tak takl trav1 trav2
triangl wc))
'(cat tail wc slatex))
(define cmd

View File

@ -28,7 +28,8 @@
(set! nw (+ nw 1))
(set! inword #t))))
(wcport port)))))
(define (go)
(set! inport (open-input-file "bib"))
(set! nl 0)

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
1347
1348

View File

@ -1192,6 +1192,26 @@
[(E) (nop)]
[(E a . a*) (assert-fixnums a a*)])
(define-primop bitwise-and safe
[(V) (K (fxsll -1 fx-shift))]
[(V a . a*)
(cond
[(or (non-fixnum? a) (ormap non-fixnum? a*)) (interrupt)]
[else
(interrupt)
(seq*
(assert-fixnums a a*)
(let f ([a (T a)] [a* a*])
(cond
[(null? a*) a]
[else
(f (prm 'logand a (T (car a*))) (cdr a*))])))])]
[(P) (K #t)]
[(P a . a*) (seq* (assert-fixnums a a*) (K #t))]
[(E) (nop)]
[(E a . a*) (assert-fixnums a a*)])
(define-primop fx+ safe
[(V x y) (cogen-value-+ x y)])