[movitz-cvs] CVS update: movitz/losp/muerte/memref.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Thu Aug 12 17:00:29 UTC 2004
Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv10882
Modified Files:
memref.lisp
Log Message:
Added memref type :location, wich is a word whose lower 2 bits are cleared.
Date: Thu Aug 12 10:00:29 2004
Author: ffjeld
Index: movitz/losp/muerte/memref.lisp
diff -u movitz/losp/muerte/memref.lisp:1.25 movitz/losp/muerte/memref.lisp:1.26
--- movitz/losp/muerte/memref.lisp:1.25 Tue Aug 10 05:58:28 2004
+++ movitz/losp/muerte/memref.lisp Thu Aug 12 10:00:29 2004
@@ -10,7 +10,7 @@
;;;; Author: Frode Vatvedt Fjeld <frodef at acm.org>
;;;; Created at: Tue Mar 6 21:25:49 2001
;;;;
-;;;; $Id: memref.lisp,v 1.25 2004/08/10 12:58:28 ffjeld Exp $
+;;;; $Id: memref.lisp,v 1.26 2004/08/12 17:00:29 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -202,6 +202,28 @@
(:load-lexical (:lexical-binding ,object-var) :ebx)
(:sarl ,movitz::+movitz-fixnum-shift+ :ecx) ; scale offset+index
(:movb (:ebx :ecx ,(offset-by 1)) :ah)))))))
+ (:location
+ (assert (= 4 movitz::+movitz-fixnum-factor+))
+ (cond
+ ((and (eq 0 offset) (eq 0 index))
+ `(with-inline-assembly (:returns :ecx)
+ (:compile-form (:result-mode :eax) ,object)
+ (:movl (:eax ,(offset-by 4)) :ecx)
+ (:andl -4 :ecx)))
+ ((eq 0 offset)
+ `(with-inline-assembly (:returns :ecx)
+ (:compile-two-forms (:eax :ecx) ,object ,index)
+ (:movl (:eax :ecx ,(offset-by 4)) :ecx)
+ (:andl -4 :ecx)))
+ (t (let ((object-var (gensym "memref-object-")))
+ `(let ((,object-var ,object))
+ (with-inline-assembly (:returns :ecx)
+ (:compile-two-forms (:ecx :ebx) ,offset ,index)
+ (:sarl ,movitz::+movitz-fixnum-shift+ :ecx)
+ (:load-lexical (:lexical-binding ,object-var) :eax)
+ (:addl :ebx :ecx)
+ (:movl (:eax :ecx ,(offset-by 4)) :ecx)
+ (:andl -4 :ecx)))))))
(:unsigned-byte32
(assert (= 4 movitz::+movitz-fixnum-factor+))
(cond
More information about the Movitz-cvs
mailing list