Ignore:
Timestamp:
Mar 21, 2012, 10:11:46 PM (8 years ago)
Author:
gb
Message:

lib/compile-ccl.lisp: Define some "optional features" for testing
hashing algorithms. :EQ-HASH-MONITOR causes EQ-hashing routines to
record the number of calls/probes involved. (The INCFs here aren't
thread-safe.) :MIXUP-HASH-CODE-NOP makes the function
CCL::MIXUP-HASH-CODE return its argument.

Implement WITH-GLOBAL-OPTIMIZATION-SETTINGS a little differently;
use it in TEST-CCL.

level-0/X86/x86-hash.lisp: in STRIP-TAG-TO-FIXNUM, shift by an
extra bit (so that results aren't always odd/even depending on
tag bits of arg.) This seems to be the right thing and should
likely be implemented on all architectures.

level-0/l0-hash.lisp: conditionally implement the new optional
features.

NEED-USE-EQL: can use EQ if arg is a fixnum or #+64-bit-target
a SINGLE-FLOAT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-hash.lisp

    r15093 r15264  
    4545  (declaim (inline hash-lock-free-p lock-free-gethash)))
    4646
     47#+eq-hash-monitor
     48(progn
     49(defparameter eq-hash-find-calls 0)
     50(defparameter eq-hash-find-probes 0)
     51(defparameter eq-hash-find-for-put-calls 0)
     52(defparameter eq-hash-find-for-put-probes 0)
     53)
    4754
    4855
     
    99106             (logbitp (the (integer 0 (#.(- target::nbits-in-word target::fixnumshift)))
    100107                        typecode)
    101                       (logior (ash 1 target::tag-fixnum)
    102                               (ash 1 target::subtag-bignum)
     108                      (logior (ash 1 target::subtag-bignum)
     109                              #-64-bit-target
    103110                              (ash 1 target::subtag-single-float)
    104111                              (ash 1 target::subtag-double-float)
     
    141148(defun mixup-hash-code (fixnum)
    142149  (declare (fixnum fixnum))
     150  #+mixup-hash-code-nop
     151  fixnum
     152  #-mixup-hash-code-nop
    143153  (the fixnum
    144154    (+ fixnum
     
    149159(defun mixup-hash-code (fixnum)
    150160  (declare (fixnum fixnum))
     161  #+mixup-hash-code-nop
     162  fixnum
     163  #-mixup-hash-code-nop
    151164  (the fixnum
    152165    (+ fixnum
     
    12771290(defun eq-hash-find (hash key)
    12781291  (declare (optimize (speed 3) (safety 0)))
     1292  #+eq-hash-monitor (progn
     1293                      (incf eq-hash-find-calls)
     1294                      (incf eq-hash-find-probes))
    12791295  (let* ((vector (nhash.vector hash))
    12801296         (hash-code
     
    13021318          (declare (fixnum secondary-hash initial-index count length))
    13031319          (loop
     1320            #+eq-hash-monitor (incf eq-hash-find-probes)
    13041321            (incf vector-index secondary-hash)
    13051322            (when (>= vector-index length)
     
    13191336(defun eq-hash-find-for-put (hash key)
    13201337  (declare (optimize (speed 3) (safety 0)))
     1338  #+eq-hash-monitor (progn
     1339                      (incf eq-hash-find-for-put-calls)
     1340                      (incf eq-hash-find-for-put-probes))
    13211341  (let* ((vector (nhash.vector hash))
    13221342         (hash-code
     
    13501370        (declare (fixnum secondary-hash initial-index count length))
    13511371        (loop
     1372          #+eq-hash-monitor (incf eq-hash-find-for-put-probes)
    13521373          (incf vector-index secondary-hash)
    13531374          (when (>= vector-index length)
Note: See TracChangeset for help on using the changeset viewer.