[movitz-cvs] CVS update: movitz/losp/muerte/integers.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Mon Jul 12 14:17:15 UTC 2004
Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv20193
Modified Files:
integers.lisp
Log Message:
Added a slow but working implementation of bignum multiplication.
Date: Mon Jul 12 07:17:15 2004
Author: ffjeld
Index: movitz/losp/muerte/integers.lisp
diff -u movitz/losp/muerte/integers.lisp:1.46 movitz/losp/muerte/integers.lisp:1.47
--- movitz/losp/muerte/integers.lisp:1.46 Mon Jul 12 06:43:43 2004
+++ movitz/losp/muerte/integers.lisp Mon Jul 12 07:17:14 2004
@@ -9,7 +9,7 @@
;;;; Created at: Wed Nov 8 18:44:57 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
-;;;; $Id: integers.lisp,v 1.46 2004/07/12 13:43:43 ffjeld Exp $
+;;;; $Id: integers.lisp,v 1.47 2004/07/12 14:17:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -1114,12 +1114,7 @@
(0 `(progn ,factor2 0))
(1 factor2)
(2 `(ash ,factor2 1))
- (t `(with-inline-assembly (:returns :eax :type integer)
- (:compile-form (:result-mode :eax) ,factor2)
- (:testb #.movitz::+movitz-fixnum-zmask+ :al)
- (:jnz '(:sub-program () (:int 107)))
- (:imull ,f1 :eax :eax)
- (:into))))))
+ (t `(no-macro-call * ,factor1 ,factor2)))))
(t `(no-macro-call * ,factor1 ,factor2)))))
(t `(* (* ,(first operands) ,(second operands)) ,@(cddr operands)))))
@@ -1271,6 +1266,12 @@
(:xorl #xff00 (:eax ,movitz:+other-type-offset+))
positive-result
)))
+ ((positive-bignum positive-bignum)
+ (do ((f y)
+ (r 0))
+ ((typep f 'fixnum) (+ r (* f x)))
+ (setf r (+ r (* most-positive-fixnum x)))
+ (setf f (- f most-positive-fixnum))))
)))
(do-it)))
(t (&rest factors)
More information about the Movitz-cvs
mailing list