Changeset 13532
 Timestamp:
 Mar 15, 2010, 6:30:41 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/level0/l0numbers.lisp
r13392 r13532 1140 1140 #+32bittarget 1141 1141 `(target::withstackshortfloats ((fnum ,number) 1142 (f2))1142 (f2)) 1143 1143 (let ((res (%unarytruncate (%shortfloat/2! fnum ,divisor f2)))) 1144 1144 (values res 1145 1145 (%shortfloat2 fnum (%shortfloat*2! (%shortfloat res f2) ,divisor f2))))) 1146 1146 #+64bittarget 1147 1147 `(let* ((temp (%shortfloat ,number)) 1148 1148 (res (%unarytruncate (/ (the shortfloat temp) … … 1152 1152 (the shortfloat (* (the shortfloat (%shortfloat res)) 1153 1153 (the shortfloat ,divisor))))))) 1154 1154 ) 1155 1155 (numbercase number 1156 1156 (fixnum 1157 (if (eql number target::targetmostnegativefixnum) 1158 (if (zerop divisor) 1159 (error 'divisionbyzero :operation 'truncate :operands (list number divisor)) 1160 (withsmallbignumbuffers ((bn number)) 1161 (multiplevaluebind (quo rem) (truncate bn divisor) 1162 (if (eq quo bn) 1163 (values number rem) 1164 (values quo rem))))) 1165 (numbercase divisor 1166 (fixnum (if (eq divisor 1) (values number 0) (%fixnumtruncate number divisor))) 1167 (bignum (values 0 number)) 1168 (doublefloat (truncateratdfloat number divisor)) 1169 (shortfloat (truncateratsfloat number divisor)) 1170 (ratio (let ((q (truncate (* number (%denominator divisor)) ; this was wrong 1171 (%numerator divisor)))) 1172 (values q ( number (* q divisor)))))))) 1157 (numbercase divisor 1158 (fixnum (if (eq divisor 1) (values number 0) (%fixnumtruncate number divisor))) 1159 (bignum (values 0 number)) 1160 (doublefloat (truncateratdfloat number divisor)) 1161 (shortfloat (truncateratsfloat number divisor)) 1162 (ratio (let ((q (truncate (* number (%denominator divisor)) ; this was wrong 1163 (%numerator divisor)))) 1164 (values q ( number (* q divisor))))))) 1173 1165 (bignum (numbercase divisor 1174 1166 (fixnum (if (eq divisor 1) (values number 0) … … 1199 1191 (/ (the shortfloat number) 1200 1192 (the shortfloat divisor))))) 1201 1202 1203 1204 1193 (values res 1194 ( (the shortfloat number) 1195 (* (the shortfloat (%shortfloat res)) 1196 (the shortfloat divisor)))))) 1205 1197 ((fixnum bignum ratio) 1206 1198 #+32bittarget 1207 1199 (target::withstackshortfloats ((fdiv divisor) 1208 (f2))1200 (f2)) 1209 1201 (let ((res (%unarytruncate (%shortfloat/2! number fdiv f2)))) 1210 1202 (values res
Note: See TracChangeset
for help on using the changeset viewer.