Changeset 7244 for branches/ia32/level-0
- Timestamp:
- Sep 17, 2007, 5:53:32 PM (13 years ago)
- Location:
- branches/ia32/level-0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ia32/level-0/PPC/ppc-numbers.lisp
r6008 r7244 313 313 ab mod m = ((u + v) mod 2^n) + 1 : u+v >= 2^n 314 314 315 What we do is use 2b and 2 n so we can do arithemetic mod 2^32 instead of315 What we do is use 2b and 2^n so we can do arithemetic mod 2^32 instead of 316 316 2^31. This reduces the whole generator to 5 instructions on the 680x0 or 317 317 80x86, and 8 on the 60x. -
branches/ia32/level-0/l0-array.lisp
r5513 r7244 484 484 fill)) 485 485 486 ; Could avoid potential memoization somehow486 ;;; Could avoid potential memoization somehow 487 487 (defun vector (&lexpr vals) 488 488 "Construct a SIMPLE-VECTOR from the given objects." … … 492 492 (dotimes (i n v) (setf (%svref v i) (%lexpr-ref vals n i))))) 493 493 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 494 504 (defun %gvector (subtag &lexpr vals) 495 505 (let* ((n (%lexpr-count vals)) -
branches/ia32/level-0/l0-numbers.lisp
r6007 r7244 1771 1771 ab mod m = ((u + v) mod 2^n) + 1 : u+v >= 2^n 1772 1772 1773 What we do is use 2b and 2 n so we can do arithemetic mod 2^32 instead of1773 What we do is use 2b and 2^n so we can do arithemetic mod 2^32 instead of 1774 1774 2^31. This reduces the whole generator to 5 instructions on the 680x0 or 1775 1775 80x86, and 8 on the 60x. … … 1781 1781 #+64-bit-target 1782 1782 (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) 1789 1794 (ldb (byte 16 0) n)))) 1790 1795 … … 1792 1797 (multiple-value-bind (high low) (%next-random-pair (%svref state 1) 1793 1798 (%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 1795 1802 (%svref state 2) low) 1796 high 1797 )) 1803 (logior high (the fixnum (logand low (ash 1 15)))))) 1798 1804 1799 1805
Note: See TracChangeset
for help on using the changeset viewer.