[movitz-cvs] CVS update: movitz/losp/muerte/basic-functions.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Tue Mar 23 10:53:25 UTC 2004
Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv30688
Modified Files:
basic-functions.lisp
Log Message:
Added operator %word-offset that constructs a new word by adding some
offset. Use with extreme care, obviously.
Date: Tue Mar 23 05:53:25 2004
Author: ffjeld
Index: movitz/losp/muerte/basic-functions.lisp
diff -u movitz/losp/muerte/basic-functions.lisp:1.4 movitz/losp/muerte/basic-functions.lisp:1.5
--- movitz/losp/muerte/basic-functions.lisp:1.4 Mon Mar 22 11:37:51 2004
+++ movitz/losp/muerte/basic-functions.lisp Tue Mar 23 05:53:25 2004
@@ -10,7 +10,7 @@
;;;; Author: Frode Vatvedt Fjeld <frodef at acm.org>
;;;; Created at: Tue Sep 4 18:41:57 2001
;;;;
-;;;; $Id: basic-functions.lisp,v 1.4 2004/03/22 16:37:51 ffjeld Exp $
+;;;; $Id: basic-functions.lisp,v 1.5 2004/03/23 10:53:25 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -343,16 +343,15 @@
(defun halt-cpu ()
(halt-cpu))
-(defun malloc-words (words)
- (malloc-clumps (1+ (truncate (1+ words) 2))))
+(define-compiler-macro %word-offset (&environment env word offset)
+ (if (movitz:movitz-constantp offset env)
+ `(with-inline-assembly (:returns :eax)
+ (:compile-form (:result-mode :eax) ,word)
+ (:addl ,(movitz:movitz-eval offset env) :eax))
+ `(with-inline-assembly (:returns :eax)
+ (:compile-two-forms (:eax :ecx) ,word ,offset)
+ (:sarl ,movitz::+movitz-fixnum-shift+ :ecx)
+ (:addl :ecx :eax))))
-(defun malloc-clumps (clumps)
- (let ((x (with-inline-assembly (:returns :eax :side-effects t)
- (:compile-form (:result-mode :ebx) clumps)
- (:shll 1 :ebx)
- (:globally (:call (:edi (:edi-offset malloc))))
- (:addl #.(movitz::tag :other) :eax))))
- (dotimes (i clumps)
- (setf (memref x -6 i :lisp) nil
- (memref x -2 i :lisp) nil))
- x))
+(defun %word-offset (word offset)
+ (%word-offset word offset))
\ No newline at end of file
More information about the Movitz-cvs
mailing list