X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Farray.lisp;h=b4fc18f37a17173a9fcced8617ac404ac0b32149;hb=fa2c3ba871c9818e5768fd8f6092ddda83a93a1f;hp=0b12e75c20fb7372ddc6a9e5425f73f192a605c9;hpb=9b634117911815fbf4154546431b4dcf13e38b47;p=sbcl.git diff --git a/src/compiler/x86/array.lisp b/src/compiler/x86/array.lisp index 0b12e75..b4fc18f 100644 --- a/src/compiler/x86/array.lisp +++ b/src/compiler/x86/array.lisp @@ -112,7 +112,7 @@ (:vop-var vop) (:save-p :compute-only) (:generator 5 - (let ((error (generate-error-code vop invalid-array-index-error + (let ((error (generate-error-code vop 'invalid-array-index-error array bound index)) (index (if (sc-is index immediate) (fixnumize (tn-value index)) @@ -150,10 +150,10 @@ #!+sb-unicode (def-full-data-vector-frobs simple-character-string character character-reg)) -(define-full-compare-and-swap simple-vector-compare-and-swap - simple-vector vector-data-offset other-pointer-lowtag - (descriptor-reg any-reg) * - %simple-vector-compare-and-swap) +(define-full-compare-and-swap %compare-and-swap-svref simple-vector + vector-data-offset other-pointer-lowtag + (descriptor-reg any-reg) * + %compare-and-swap-svref) ;;;; integer vectors whose elements are smaller than a byte, i.e., ;;;; bit, 2-bit, and 4-bit vectors @@ -686,13 +686,32 @@ ;;; These vops are useful for accessing the bits of a vector ;;; irrespective of what type of vector it is. -(define-full-reffer+offset raw-bits-with-offset * 0 other-pointer-lowtag (unsigned-reg) - unsigned-num %raw-bits-with-offset) -(define-full-setter+offset set-raw-bits-with-offset * 0 other-pointer-lowtag (unsigned-reg) - unsigned-num %set-raw-bits-with-offset) +(define-full-reffer vector-raw-bits * vector-data-offset other-pointer-lowtag + (unsigned-reg) unsigned-num %vector-raw-bits) +(define-full-setter set-vector-raw-bits * vector-data-offset other-pointer-lowtag + (unsigned-reg) unsigned-num %set-vector-raw-bits) ;;;; miscellaneous array VOPs (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 :dword :base array + :scale 1 :index index + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag)) + diff :lock) + (move result diff)))