X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Farray.lisp;h=f365216b10fa76df37934d1586dbb47f80ae9246;hb=fa2c3ba871c9818e5768fd8f6092ddda83a93a1f;hp=4a898393d89f30e2ed44e6f1a2762249995d6908;hpb=615e831bf87b357d8690b893068fd62b0f285c7a;p=sbcl.git diff --git a/src/compiler/x86-64/array.lisp b/src/compiler/x86-64/array.lisp index 4a89839..f365216 100644 --- a/src/compiler/x86-64/array.lisp +++ b/src/compiler/x86-64/array.lisp @@ -730,3 +730,22 @@ (define-vop (get-vector-subtype get-header-data)) (define-vop (set-vector-subtype set-header-data)) + +;;;; ATOMIC-INCF for arrays + +(define-vop (array-atomic-incf/word) + (:translate %array-atomic-incf/word) + (:policy :fast-safe) + (:args (array :scs (descriptor-reg)) + (index :scs (any-reg)) + (diff :scs (unsigned-reg) :target result)) + (:arg-types * positive-fixnum unsigned-num) + (:results (result :scs (unsigned-reg))) + (:result-types unsigned-num) + (:generator 4 + (inst xadd (make-ea :qword :base array + :scale 1 :index index + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag)) + diff :lock) + (move result diff)))