Changeset 10152
 Timestamp:
 Jul 19, 2008, 10:15:52 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/level0/l0numbers.lisp
r9882 r10152 467 467 (if (and (eq int 0)(= sfloat 0.0s0)) 468 468 0 469 (#+32bittarget ppc32::withstackshortfloats #+32bittarget ((s1 int))469 (#+32bittarget target::withstackshortfloats #+32bittarget ((s1 int)) 470 470 #32bittarget let* #32bittarget ((s1 (%inttosfloat int))) 471 471 (locally … … 1068 1068 (%doublefloat2 fnum (%doublefloat*2! (%doublefloat res f2) ,divisor f2)))))) 1069 1069 (truncateratsfloat (number divisor) 1070 #+ ppc32target1071 `( ppc32::withstackshortfloats ((fnum ,number)1070 #+32bittarget 1071 `(target::withstackshortfloats ((fnum ,number) 1072 1072 (f2)) 1073 1073 (let ((res (%unarytruncate (%shortfloat/2! fnum ,divisor f2)))) … … 1085 1085 (numbercase number 1086 1086 (fixnum 1087 (if (eql number mostnegativefixnum)1087 (if (eql number target::targetmostnegativefixnum) 1088 1088 (if (zerop divisor) 1089 1089 (error 'divisionbyzero :operation 'truncate :operands (list number divisor)) … … 1103 1103 (bignum (numbercase divisor 1104 1104 (fixnum (if (eq divisor 1) (values number 0) 1105 (if (eq divisor mostnegativefixnum);; << aargh1105 (if (eq divisor target::targetmostnegativefixnum);; << aargh 1106 1106 (withsmallbignumbuffers ((bd divisor)) 1107 1107 (bignumtruncate number bd)) … … 1118 1118 (numbercase divisor 1119 1119 (shortfloat 1120 #+ ppc32target1121 ( ppc32::withstackshortfloats ((f2))1120 #+32bittarget 1121 (target::withstackshortfloats ((f2)) 1122 1122 (let ((res (%unarytruncate (%shortfloat/2! number divisor f2)))) 1123 1123 (values res … … 1134 1134 (the shortfloat divisor)))))) 1135 1135 ((fixnum bignum ratio) 1136 #+ ppc32target1137 ( ppc32::withstackshortfloats ((fdiv divisor)1136 #+32bittarget 1137 (target::withstackshortfloats ((fdiv divisor) 1138 1138 (f2)) 1139 1139 (let ((res (%unarytruncate (%shortfloat/2! number fdiv f2)))) … … 1193 1193 (%unarytruncate (%doublefloat/2! fnum ,divisor f2)))) 1194 1194 (truncateratsfloat (number divisor) 1195 #+ ppc32target1196 `( ppc32::withstackshortfloats ((fnum ,number)1195 #+32bittarget 1196 `(target::withstackshortfloats ((fnum ,number) 1197 1197 (f2)) 1198 1198 (%unarytruncate (%shortfloat/2! fnum ,divisor f2))) … … 1203 1203 (numbercase number 1204 1204 (fixnum 1205 (if (eql number mostnegativefixnum)1205 (if (eql number target::targetmostnegativefixnum) 1206 1206 (if (zerop divisor) 1207 1207 (error 'divisionbyzero :operation 'truncate :operands (list number divisor)) … … 1221 1221 (bignum (numbercase divisor 1222 1222 (fixnum (if (eq divisor 1) number 1223 (if (eq divisor mostnegativefixnum)1223 (if (eq divisor target::targetmostnegativefixnum) 1224 1224 (withsmallbignumbuffers ((bd divisor)) 1225 1225 (bignumtruncate number bd :norem)) … … 1252 1252 (numbercase divisor 1253 1253 ((fixnum bignum ratio) 1254 #+ ppc32target1255 ( ppc32::withstackshortfloats ((fdiv divisor)1254 #+32bittarget 1255 (target::withstackshortfloats ((fdiv divisor) 1256 1256 (f2)) 1257 1257 (let ((res (%unarytruncate (%shortfloat/2! number fdiv f2)))) … … 1261 1261 (the shortfloat (%shortfloat divisor))))) 1262 1262 (shortfloat 1263 #+ ppc32target1264 ( ppc32::withstackshortfloats ((ddiv divisor)1263 #+32bittarget 1264 (target::withstackshortfloats ((ddiv divisor) 1265 1265 (f2)) 1266 1266 (%unarytruncate (%shortfloat/2! number ddiv f2))) … … 1474 1474 (numbercase divisor 1475 1475 (fixnum 1476 (if (eq divisor mostnegativefixnum)1476 (if (eq divisor target::targetmostnegativefixnum) 1477 1477 (nthvalue 1 (truncate number divisor)) 1478 1478 (bignumtruncatebyfixnumnoquo number divisor))) … … 1720 1720 (mixuphashcode 1721 1721 (logand (getinternalrealtime) 1722 (1 mostpositivefixnum))))))1722 (1 target::targetmostpositivefixnum)))))) 1723 1723 (high (ldb (byte 16 16) (if (zerop ticks) #x10000 ticks))) 1724 1724 (low (ldb (byte 16 0) ticks))) … … 1837 1837 (declare (fixnum longwords index bits) 1838 1838 (dynamicextent dividend) 1839 (type (simplearray (unsignedbyte 16) (*)) 16bitdividend) ;lie1839 (type (simplearray (unsignedbyte 16) (*)) 16bitdividend) ;lie 1840 1840 (optimize (speed 3) (safety 0))) 1841 1841 (loop 1842 ;; This had better inline due to the lie above, or it will error 1843 (setf (aref 16bitdividend index) (%nextrandomseed state)) 1844 (decf halfwords) 1845 (when (<= halfwords 0) (return)) 1846 (setf (aref 16bitdividend (the fixnum (1 index))) 1847 (%nextrandomseed state)) 1848 (decf halfwords) 1849 (when (<= halfwords 0) (return)) 1850 (incf index 2)) 1842 ;; This had better inline due to the lie above, or it will error 1843 #+bigendiantarget 1844 (setf (aref 16bitdividend index) (%nextrandomseed state)) 1845 #+littleendiantarget 1846 (setf (aref 16bitdividend (the fixnum (1 index))) 1847 (%nextrandomseed state)) 1848 (decf halfwords) 1849 (when (<= halfwords 0) (return)) 1850 #+bigendiantarget 1851 (setf (aref 16bitdividend (the fixnum (1 index))) 1852 (%nextrandomseed state)) 1853 #+littleendiantarget 1854 (setf (aref 16bitdividend index) (%nextrandomseed state)) 1855 (decf halfwords) 1856 (when (<= halfwords 0) (return)) 1857 (incf index 2)) 1851 1858 ;; The bignum code expects normalized bignums 1852 1859 (let* ((result (mod dividend number))) … … 1856 1863 1857 1864 (defun %floatrandom (number state) 1858 (let ((ratio (gvector :ratio (random mostpositivefixnum state)mostpositivefixnum)))1865 (let ((ratio (gvector :ratio (random target::targetmostpositivefixnum state) target::targetmostpositivefixnum))) 1859 1866 (declare (dynamicextent ratio)) 1860 1867 (* number ratio))) … … 1870 1877 `(let ((,n ,nexp)) 1871 1878 (if (minusp (the fixnum ,n)) 1872 (if (eq ,n mostnegativefixnum)1879 (if (eq ,n target::targetmostnegativefixnum) 1873 1880 ( ,n) 1874 1881 (the fixnum ( (the fixnum ,n)))) … … 1894 1901 (numbercase n2 1895 1902 (fixnum 1896 (if (eql n1 mostnegativefixnum)1897 (if (eql n2 mostnegativefixnum)1898 ( mostnegativefixnum)1899 (bignumfixnumgcd ( mostnegativefixnum) (abs n2)))1900 (if (eql n2 mostnegativefixnum)1901 (bignumfixnumgcd ( mostnegativefixnum) (abs n1))1903 (if (eql n1 target::targetmostnegativefixnum) 1904 (if (eql n2 target::targetmostnegativefixnum) 1905 ( target::targetmostnegativefixnum) 1906 (bignumfixnumgcd ( target::targetmostnegativefixnum) (abs n2))) 1907 (if (eql n2 target::targetmostnegativefixnum) 1908 (bignumfixnumgcd ( target::targetmostnegativefixnum) (abs n1)) 1902 1909 (locally 1903 1910 (declare (optimize (speed 3) (safety 0)) … … 1906 1913 (if (minusp n2)(setq n2 (the fixnum ( n2)))) 1907 1914 (%fixnumgcd n1 n2))))) 1908 (bignum (if (eql n1 mostnegativefixnum)1909 (%bignumbignumgcd n2 ( mostnegativefixnum))1915 (bignum (if (eql n1 target::targetmostnegativefixnum) 1916 (%bignumbignumgcd n2 ( target::targetmostnegativefixnum)) 1910 1917 (bignumfixnumgcd (bignumabs n2)(fixnumabs n1)))))) 1911 1918 (bignum 1912 1919 (numbercase n2 1913 1920 (fixnum 1914 (if (eql n2 mostnegativefixnum)1921 (if (eql n2 target::targetmostnegativefixnum) 1915 1922 (%bignumbignumgcd (bignumabs n1)(fixnumabs n2)) 1916 1923 (bignumfixnumgcd (bignumabs n1)(fixnumabs n2))))
Note: See TracChangeset
for help on using the changeset viewer.