Changeset 7244 for branches/ia32/level-0


Ignore:
Timestamp:
Sep 17, 2007, 5:53:32 PM (13 years ago)
Author:
rme
Message:

Merged trunk changes r6975:7243

Location:
branches/ia32/level-0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/level-0/PPC/ppc-numbers.lisp

    r6008 r7244  
    313313    ab mod m = ((u + v) mod 2^n) + 1   :  u+v >= 2^n
    314314
    315 What we do is use 2b and 2n so we can do arithemetic mod 2^32 instead of
     315What we do is use 2b and 2^n so we can do arithemetic mod 2^32 instead of
    3163162^31.  This reduces the whole generator to 5 instructions on the 680x0 or
    31731780x86, and 8 on the 60x.
  • branches/ia32/level-0/l0-array.lisp

    r5513 r7244  
    484484    fill))
    485485
    486 ; Could avoid potential memoization somehow
     486;;; Could avoid potential memoization somehow
    487487(defun vector (&lexpr vals)
    488488  "Construct a SIMPLE-VECTOR from the given objects."
     
    492492    (dotimes (i n v) (setf (%svref v i) (%lexpr-ref vals n i)))))
    493493
     494;;; CALL-ARGUMENTS-LIMIT.
     495(defun list-to-vector (elts)
     496  (let* ((n (length elts)))
     497    (declare (fixnum n))
     498    (if (< n (floor #x8000 target::node-size))
     499      (apply #'vector elts)
     500      (make-array n :initial-contents elts))))
     501
     502             
     503   
    494504(defun %gvector (subtag &lexpr vals)
    495505  (let* ((n (%lexpr-count vals))
  • branches/ia32/level-0/l0-numbers.lisp

    r6007 r7244  
    17711771    ab mod m = ((u + v) mod 2^n) + 1   :  u+v >= 2^n
    17721772
    1773 What we do is use 2b and 2n so we can do arithemetic mod 2^32 instead of
     1773What we do is use 2b and 2^n so we can do arithemetic mod 2^32 instead of
    177417742^31.  This reduces the whole generator to 5 instructions on the 680x0 or
    1775177580x86, and 8 on the 60x.
     
    17811781#+64-bit-target
    17821782(defun %next-random-pair (high low)
    1783   (let* ((n (nth-value
    1784              1
    1785              (%multiply 42871 (dpb (ldb (byte 15 0) high)
    1786                                       (byte 16 16)
    1787                                       (ldb (byte 16 0) low ))))))
    1788     (values (ldb (byte 16 16) n)
     1783  (declare (type (unsigned-byte 16) high low))
     1784  (let* ((n0
     1785          (%i* 42871
     1786             (the  (unsigned-byte 31)
     1787               (logior (the (unsigned-byte 31)
     1788                         (ash (ldb (byte 15 0) high) 16))
     1789                       (the (unsigned-byte 16)
     1790                         (ldb (byte 16 0) low))))))
     1791         (n (fast-mod n0 (1- (expt 2 31)))))
     1792    (declare (fixnum n))
     1793    (values (ldb (byte 15 16) n)
    17891794            (ldb (byte 16 0) n))))
    17901795
     
    17921797  (multiple-value-bind (high low) (%next-random-pair (%svref state 1)
    17931798                                                     (%svref state 2))
    1794     (setf (%svref state 1) (ldb (byte 15 0) high)
     1799    (declare (type (unsigned-byte 15) high)
     1800             (type (unsigned-byte 16) low))
     1801    (setf (%svref state 1) high
    17951802          (%svref state 2) low)
    1796     high
    1797     ))
     1803    (logior high (the fixnum (logand low (ash 1 15))))))
    17981804
    17991805
Note: See TracChangeset for help on using the changeset viewer.