X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fassembly%2Fx86%2Falloc.lisp;h=ef7a0261d59b102fbe3a07b3d8c5e7925648b193;hb=37fbb0be837f1d17650c7329469819dd31b762e1;hp=897855b5572141b612aa27313ed03e0eea3b9835;hpb=6147892310586401bae00de7e65a386c72531136;p=sbcl.git diff --git a/src/assembly/x86/alloc.lisp b/src/assembly/x86/alloc.lisp index 897855b..ef7a026 100644 --- a/src/assembly/x86/alloc.lisp +++ b/src/assembly/x86/alloc.lisp @@ -100,11 +100,12 @@ (inst push other) (inst push target) (emit-label get-tls-index-lock) - (inst mov target 1) - (inst xor eax-tn eax-tn) - (inst cmpxchg (make-ea-for-symbol-value *tls-index-lock*) - target :lock) - (inst jmp :ne get-tls-index-lock) + (let ((not-eax ,(if (eql 'eax reg) 'other 'target))) + (inst mov not-eax 1) + (inst xor eax-tn eax-tn) + (inst cmpxchg (make-ea-for-symbol-value *tls-index-lock*) + not-eax :lock) + (inst jmp :ne get-tls-index-lock)) ;; The symbol is now in OTHER. (inst pop other) ;; Now with the lock held, see if the symbol's tls index has been