* Added $make-flonum and $flonum-set! prims.

This commit is contained in:
Abdulaziz Ghuloum 2007-06-10 12:09:01 +03:00
parent 7246be795d
commit 9a31a8f0d3
3 changed files with 22 additions and 0 deletions

Binary file not shown.

View File

@ -566,6 +566,8 @@
[$bytevector-set! $bytes]
[$flonum-u8-ref $flonums]
[$make-flonum $flonums]
[$flonum-set! $flonums]
[$make-bignum $bignums]
[$bignum-positive? $bignums]

View File

@ -741,6 +741,26 @@
[(P s i) (K #t)]
[(E s i) (nop)])
(define-primop $make-flonum unsafe
[(V)
(with-tmp ([x (prm 'alloc (K (align flonum-size)) (K vector-tag))])
(prm 'mset x (K (- vector-tag)) (K flonum-tag))
x)]
[(P str) (K #t)]
[(E str) (nop)])
(define-primop $flonum-set! unsafe
[(E x i v)
(record-case i
[(constant i)
(unless (and (fixnum? i) (fx<= 0 i) (fx<= i 7))
(interrupt))
(prm 'bset/h (T x)
(K (+ (- 7 i) (- disp-bytevector-data bytevector-tag)))
(prm 'sll (T v) (K (- 8 fx-shift))))]
[else (interrupt)])])
/section)
(section ;;; ratnums