X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fmacros.lisp;h=c010cfd3398f0216493dbd865ddc5e813cf6242b;hb=670d28c10c178142146f6916c5fa0967732f3a8f;hp=8a1dc871a366f93391798ea58acf149e78651b5b;hpb=5de74c72e5a9522c7fdd3dbb31a39641e9de8877;p=sbcl.git diff --git a/src/compiler/x86/macros.lisp b/src/compiler/x86/macros.lisp index 8a1dc87..c010cfd 100644 --- a/src/compiler/x86/macros.lisp +++ b/src/compiler/x86/macros.lisp @@ -93,7 +93,7 @@ `(progn (inst mov ,reg (make-ea-for-symbol-tls-index ,symbol)) (inst fs-segment-prefix) - (inst mov ,reg (make-ea :dword :scale 1 :index ,reg)))) + (inst mov ,reg (make-ea :dword :base ,reg)))) #!-sb-thread (defmacro load-tl-symbol-value (reg symbol) `(load-symbol-value ,reg ,symbol)) @@ -102,7 +102,7 @@ `(progn (inst mov ,temp (make-ea-for-symbol-tls-index ,symbol)) (inst fs-segment-prefix) - (inst mov (make-ea :dword :scale 1 :index ,temp) ,reg))) + (inst mov (make-ea :dword :base ,temp) ,reg))) #!-sb-thread (defmacro store-tl-symbol-value (reg symbol temp) (declare (ignore temp)) @@ -332,11 +332,6 @@ ;;; place and there's no logical single place to attach documentation. ;;; grep (mostly in src/runtime) is your friend -;;; FIXME: *PSEUDO-ATOMIC-FOO* could be made into *PSEUDO-ATOMIC-BITS*, -;;; set with a single operation and cleared with SHR *PSEUDO-ATOMIC-BITS*,-2; -;;; the ATOMIC bit is bit 0, the INTERRUPTED bit is bit 1, and you check -;;; the C flag after the shift to see whether you were interrupted. -;;; ;;; KLUDGE: since the stack on the x86 is treated conservatively, it ;;; does not matter whether a signal occurs during construction of a ;;; dynamic-extent object, as the half-finished construction of the @@ -351,15 +346,13 @@ (with-unique-names (label) `(let ((,label (gen-label))) (inst fs-segment-prefix) - (inst mov (make-ea :byte :disp (* 4 thread-pseudo-atomic-atomic-slot)) + (inst or (make-ea :byte :disp (* 4 thread-pseudo-atomic-bits-slot)) (fixnumize 1)) ,@forms (inst fs-segment-prefix) - (inst mov (make-ea :byte :disp (* 4 thread-pseudo-atomic-atomic-slot)) 0) - (inst fs-segment-prefix) - (inst cmp (make-ea :byte - :disp (* 4 thread-pseudo-atomic-interrupted-slot)) 0) - (inst jmp :eq ,label) + (inst xor (make-ea :byte :disp (* 4 thread-pseudo-atomic-bits-slot)) + (fixnumize 1)) + (inst jmp :z ,label) ;; if PAI was set, interrupts were disabled at the same ;; time using the process signal mask. (inst break pending-interrupt-trap) @@ -372,27 +365,20 @@ ;; FIXME: The MAKE-EA noise should become a MACROLET macro ;; or something. (perhaps SVLB, for static variable low ;; byte) - (inst mov (make-ea :byte :disp (+ nil-value - (static-symbol-offset - '*pseudo-atomic-atomic*) - (ash symbol-value-slot word-shift) - (- other-pointer-lowtag))) + (inst or (make-ea :byte :disp (+ nil-value + (static-symbol-offset + '*pseudo-atomic-bits*) + (ash symbol-value-slot word-shift) + (- other-pointer-lowtag))) (fixnumize 1)) ,@forms - (inst mov (make-ea :byte :disp (+ nil-value + (inst xor (make-ea :byte :disp (+ nil-value (static-symbol-offset - '*pseudo-atomic-atomic*) + '*pseudo-atomic-bits*) (ash symbol-value-slot word-shift) (- other-pointer-lowtag))) - 0) - (inst cmp (make-ea :byte - :disp (+ nil-value - (static-symbol-offset - '*pseudo-atomic-interrupted*) - (ash symbol-value-slot word-shift) - (- other-pointer-lowtag))) - 0) - (inst jmp :eq ,label) + (fixnumize 1)) + (inst jmp :z ,label) ;; if PAI was set, interrupts were disabled at the same ;; time using the process signal mask. (inst break pending-interrupt-trap)