From 79c31416cf12930c15651760de7c82349d4acdfb Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 14 Nov 2007 12:39:23 -0500 Subject: [PATCH] * Added $flonum-sbe primop for extracting the signed-biased-exponent of a flonum. --- scheme/makefile.ss | 1 + scheme/pass-specify-rep-primops.ss | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/scheme/makefile.ss b/scheme/makefile.ss index 2e52472..fdff7f2 100755 --- a/scheme/makefile.ss +++ b/scheme/makefile.ss @@ -433,6 +433,7 @@ [$fl>= $flonums] [$flround $flonums] [$fixnum->flonum $flonums] + [$flonum-sbe $flonums] [$make-bignum $bignums] [$bignum-positive? $bignums] [$bignum-size $bignums] diff --git a/scheme/pass-specify-rep-primops.ss b/scheme/pass-specify-rep-primops.ss index 049a38b..0753552 100644 --- a/scheme/pass-specify-rep-primops.ss +++ b/scheme/pass-specify-rep-primops.ss @@ -980,6 +980,15 @@ (prm 'fl:store x (K (- disp-flonum-data vector-tag))) x))]) +(define-primop $flonum-sbe unsafe + [(V x) + (prm 'sll + (prm 'srl + (prm 'mref (T x) + (K (- (+ disp-flonum-data 4) vector-tag))) + (K 20)) + (K fixnum-shift))]) + /section) (section ;;; ratnums