summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
05e9b54)
* We had two, of which CEIL-POWER-OF-TWO with arguments that already
were powers of two returned the *next* power of two, and not the
argument, whereas POWER-OF-TWO-CEILING returned the argument if
it already was a power of two.
As far as I can tell returning the argument is fine in those case
in places where CEIL-POWER-OF-TWO was used, so replace it with
POWER-OF-TWO-CEILING -- which really doesn't have to be inline.
* fixed some bugs revealed by Paul Dietz' test suite:
** interval arithmetic during type derivation used inexact integer
to single-float coercions.
* fixed some bugs revealed by Paul Dietz' test suite:
** interval arithmetic during type derivation used inexact integer
to single-float coercions.
- ** artihmetic operations involving large integers and single
+ ** arithmetic operations involving large integers and single
floats give the same results in compiled and interpreted code.
** deriving the result type of COERCE no longer signals an error
if the derived type of the second argument is a MEMBER type
floats give the same results in compiled and interpreted code.
** deriving the result type of COERCE no longer signals an error
if the derived type of the second argument is a MEMBER type
"BIT-VECTOR-="
"READ-EVALUATED-FORM"
"MAKE-UNPRINTABLE-OBJECT"
"BIT-VECTOR-="
"READ-EVALUATED-FORM"
"MAKE-UNPRINTABLE-OBJECT"
;; ..and macros..
"COLLECT"
;; ..and macros..
"COLLECT"
(%shrink-vector string size)
string)))
,@body))))
(%shrink-vector string size)
string)))
,@body))))
+
+;;; The smallest power of two that is equal to or greater than X.
+(defun power-of-two-ceiling (x)
+ (declare (index x))
+ (ash 1 (integer-length (1- x))))
-(defun ceil-power-of-two (num)
- (declare (type index num))
- (ash 1 (integer-length num)))
-
(declaim (inline index-for-hashing))
(defun index-for-hashing (hash length)
(declare (type hash hash length))
(declaim (inline index-for-hashing))
(defun index-for-hashing (hash length)
(declare (type hash hash length))
;; Note that this has not yet been audited for
;; correctness. It just seems to work. -- CSR, 2002-11-02
(scaled-size (truncate (/ (float size+1) rehash-threshold)))
;; Note that this has not yet been audited for
;; correctness. It just seems to work. -- CSR, 2002-11-02
(scaled-size (truncate (/ (float size+1) rehash-threshold)))
- (length (ceil-power-of-two (max scaled-size
- (1+ +min-hash-table-size+))))
+ (length (power-of-two-ceiling (max scaled-size
+ (1+ +min-hash-table-size+))))
(index-vector (make-array length
:element-type
'(unsigned-byte #.sb!vm:n-word-bits)
(index-vector (make-array length
:element-type
'(unsigned-byte #.sb!vm:n-word-bits)
(old-hash-vector (hash-table-hash-vector table))
(old-size (length old-next-vector))
(new-size
(old-hash-vector (hash-table-hash-vector table))
(old-size (length old-next-vector))
(new-size
(let ((rehash-size (hash-table-rehash-size table)))
(etypecase rehash-size
(fixnum
(let ((rehash-size (hash-table-rehash-size table)))
(etypecase rehash-size
(fixnum
;; bits at the low end.
(logand (1- vector-length) (- line-size)))
;; bits at the low end.
(logand (1- vector-length) (- line-size)))
-;;; The smallest power of two that is equal to or greater then X.
-(declaim (inline power-of-two-ceiling))
-(defun power-of-two-ceiling (x)
- (ash 1 (integer-length (1- x))))
-
(defun cache-statistics (cache)
(let* ((vector (cache-vector cache))
(size (length vector))
(defun cache-statistics (cache)
(let* ((vector (cache-vector cache))
(size (length vector))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)