Ignore:
Timestamp:
Jun 19, 2008, 6:31:57 PM (11 years ago)
Author:
rme
Message:

%bignum-random: Conditionalize for big/little endian targets.

File:
1 edited

Legend:

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

    r9366 r9795  
    18171817    (declare (fixnum long-words words words-2 index bits)
    18181818             (dynamic-extent dividend)
    1819              (type (simple-array (unsigned-byte 16) (*)) 16-bit-dividend)       ; lie
     1819             (type (simple-array (unsigned-byte 16) (*)) 16-bit-dividend) ;lie
    18201820             (optimize (speed 3) (safety 0)))
    18211821    (loop
    1822       ;; This had better inline due to the lie above, or it will error
    1823       (setf (aref 16-bit-dividend index) (%next-random-seed state))
    1824       (decf half-words)
    1825       (when (<= half-words 0) (return))
    1826       (setf (aref 16-bit-dividend (the fixnum (1- index)))
    1827             (%next-random-seed state))
    1828       (decf half-words)
    1829       (when (<= half-words 0) (return))
    1830       (incf index 2))
     1822       ;; This had better inline due to the lie above, or it will error
     1823       #+big-endian-target
     1824       (setf (aref 16-bit-dividend index) (%next-random-seed state))
     1825       #+little-endian-target
     1826       (setf (aref 16-bit-dividend (the fixnum (1- index)))
     1827             (%next-random-seed state))
     1828       (decf half-words)
     1829       (when (<= half-words 0) (return))
     1830       #+big-endian-target
     1831       (setf (aref 16-bit-dividend (the fixnum (1- index)))
     1832             (%next-random-seed state))
     1833       #+little-endian-target
     1834       (setf (aref 16-bit-dividend index) (%next-random-seed state))
     1835       (decf half-words)
     1836       (when (<= half-words 0) (return))
     1837       (incf index 2))
    18311838    ;; The bignum code expects normalized bignums
    18321839    (let* ((result (mod dividend number)))
Note: See TracChangeset for help on using the changeset viewer.