X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fmacros.lisp;h=9d6ce4a1161103c5a1e81cd5805d4a7e01ac9ba7;hb=9be48f2a73ca5f4cc0848b8c0adad7127de10373;hp=7df414a388dff55b95e444102b1d237cc2322663;hpb=6fa968aaa8051da23cc3153a1c0e67addbea85f6;p=sbcl.git diff --git a/src/compiler/x86/macros.lisp b/src/compiler/x86/macros.lisp index 7df414a..9d6ce4a 100644 --- a/src/compiler/x86/macros.lisp +++ b/src/compiler/x86/macros.lisp @@ -66,14 +66,22 @@ (defmacro popw (ptr &optional (slot 0) (lowtag 0)) `(inst pop (make-ea-for-object-slot ,ptr ,slot ,lowtag))) + +(defmacro make-ea-for-vector-data (object &key (size :dword) (offset 0) + index (scale (ash (width-bits size) -3))) + `(make-ea ,size :base ,object :index ,index :scale ,scale + :disp (- (+ (* vector-data-offset n-word-bytes) + (* ,offset ,scale)) + other-pointer-lowtag))) ;;;; macros to generate useful values (defmacro load-symbol (reg symbol) `(inst mov ,reg (+ nil-value (static-symbol-offset ,symbol)))) -(defmacro make-ea-for-symbol-value (symbol) - `(make-ea :dword +(defmacro make-ea-for-symbol-value (symbol &optional (width :dword)) + (declare (type symbol symbol)) + `(make-ea ,width :disp (+ nil-value (static-symbol-offset ',symbol) (ash symbol-value-slot word-shift) @@ -87,6 +95,7 @@ #!+sb-thread (defmacro make-ea-for-symbol-tls-index (symbol) + (declare (type symbol symbol)) `(make-ea :dword :disp (+ nil-value (static-symbol-offset ',symbol) @@ -367,21 +376,10 @@ (defmacro pseudo-atomic (&rest forms) (with-unique-names (label) `(let ((,label (gen-label))) - ;; FIXME: The MAKE-EA noise should become a MACROLET macro - ;; or something. (perhaps SVLB, for static variable low - ;; byte) - (inst or (make-ea :byte :disp (+ nil-value - (static-symbol-offset - '*pseudo-atomic-bits*) - (ash symbol-value-slot word-shift) - (- other-pointer-lowtag))) + (inst or (make-ea-for-symbol-value *pseudo-atomic-bits* :byte) (fixnumize 1)) ,@forms - (inst xor (make-ea :byte :disp (+ nil-value - (static-symbol-offset - '*pseudo-atomic-bits*) - (ash symbol-value-slot word-shift) - (- other-pointer-lowtag))) + (inst xor (make-ea-for-symbol-value *pseudo-atomic-bits* :byte) (fixnumize 1)) (inst jmp :z ,label) ;; if PAI was set, interrupts were disabled at the same