X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Farray.lisp;h=ecd91fd5765ae17b52b587a6500504e144669fc5;hb=19319c931fc1636835dbef71808cc10e252bcf45;hp=22ab26c0db245306698c8c9a0dc8512d781bcb49;hpb=a6b91f356da1b5ae2987f79db9bd137970512959;p=sbcl.git diff --git a/src/compiler/x86/array.lisp b/src/compiler/x86/array.lisp index 22ab26c..ecd91fd 100644 --- a/src/compiler/x86/array.lisp +++ b/src/compiler/x86/array.lisp @@ -141,8 +141,8 @@ (def-full-data-vector-frobs simple-vector * descriptor-reg any-reg) (def-full-data-vector-frobs simple-array-unsigned-byte-32 unsigned-num unsigned-reg) - (def-full-data-vector-frobs simple-array-signed-byte-30 tagged-num any-reg) - (def-full-data-vector-frobs simple-array-unsigned-byte-29 positive-fixnum any-reg) + (def-full-data-vector-frobs simple-array-fixnum tagged-num any-reg) + (def-full-data-vector-frobs simple-array-unsigned-fixnum positive-fixnum any-reg) (def-full-data-vector-frobs simple-array-signed-byte-32 signed-num signed-reg) (def-full-data-vector-frobs simple-array-unsigned-byte-31 unsigned-num @@ -321,7 +321,7 @@ (:args (object :scs (descriptor-reg)) (index :scs (any-reg immediate))) (:info offset) - (:arg-types simple-array-single-float positive-fixnum + (:arg-types simple-array-single-float tagged-num (:constant (constant-displacement other-pointer-lowtag 4 vector-data-offset))) (:results (value :scs (single-reg))) @@ -338,7 +338,7 @@ (index :scs (any-reg immediate)) (value :scs (single-reg) :target result)) (:info offset) - (:arg-types simple-array-single-float positive-fixnum + (:arg-types simple-array-single-float tagged-num (:constant (constant-displacement other-pointer-lowtag 4 vector-data-offset)) single-float) @@ -372,7 +372,7 @@ (index :scs (any-reg immediate))) (:info offset) (:arg-types simple-array-double-float - positive-fixnum + tagged-num (:constant (constant-displacement other-pointer-lowtag 8 vector-data-offset))) (:results (value :scs (double-reg))) @@ -389,7 +389,7 @@ (index :scs (any-reg immediate)) (value :scs (double-reg) :target result)) (:info offset) - (:arg-types simple-array-double-float positive-fixnum + (:arg-types simple-array-double-float tagged-num (:constant (constant-displacement other-pointer-lowtag 8 vector-data-offset)) double-float) @@ -424,7 +424,7 @@ (:args (object :scs (descriptor-reg)) (index :scs (any-reg immediate))) (:info offset) - (:arg-types simple-array-complex-single-float positive-fixnum + (:arg-types simple-array-complex-single-float tagged-num (:constant (constant-displacement other-pointer-lowtag 8 vector-data-offset))) (:results (value :scs (complex-single-reg))) @@ -447,7 +447,7 @@ (index :scs (any-reg immediate)) (value :scs (complex-single-reg) :target result)) (:info offset) - (:arg-types simple-array-complex-single-float positive-fixnum + (:arg-types simple-array-complex-single-float tagged-num (:constant (constant-displacement other-pointer-lowtag 8 vector-data-offset)) complex-single-float) @@ -490,7 +490,7 @@ (:args (object :scs (descriptor-reg)) (index :scs (any-reg immediate))) (:info offset) - (:arg-types simple-array-complex-double-float positive-fixnum + (:arg-types simple-array-complex-double-float tagged-num (:constant (constant-displacement other-pointer-lowtag 16 vector-data-offset))) (:results (value :scs (complex-double-reg))) @@ -512,7 +512,7 @@ (index :scs (any-reg immediate)) (value :scs (complex-double-reg) :target result)) (:info offset) - (:arg-types simple-array-complex-double-float positive-fixnum + (:arg-types simple-array-complex-double-float tagged-num (:constant (constant-displacement other-pointer-lowtag 16 vector-data-offset)) complex-double-float) @@ -560,9 +560,9 @@ (:translate data-vector-ref-with-offset) (:policy :fast-safe) (:args (object :scs (descriptor-reg)) - (index :scs (unsigned-reg immediate))) + (index :scs (signed-reg immediate))) (:info offset) - (:arg-types ,ptype positive-fixnum + (:arg-types ,ptype tagged-num (:constant (constant-displacement other-pointer-lowtag 1 vector-data-offset))) (:results (value :scs ,scs)) @@ -581,11 +581,11 @@ (:translate data-vector-set-with-offset) (:policy :fast-safe) (:args (object :scs (descriptor-reg) :to (:eval 0)) - (index :scs (unsigned-reg immediate) :to (:eval 0)) + (index :scs (signed-reg immediate) :to (:eval 0)) (value :scs ,scs ,@(unless 8-bit-tns-p '(:target eax)))) (:info offset) - (:arg-types ,ptype positive-fixnum + (:arg-types ,ptype tagged-num (:constant (constant-displacement other-pointer-lowtag 1 vector-data-offset)) ,element-type) @@ -631,9 +631,9 @@ (:translate data-vector-ref-with-offset) (:policy :fast-safe) (:args (object :scs (descriptor-reg)) - (index :scs (unsigned-reg immediate))) + (index :scs (signed-reg immediate))) (:info offset) - (:arg-types ,ptype positive-fixnum + (:arg-types ,ptype tagged-num (:constant (constant-displacement other-pointer-lowtag 2 vector-data-offset))) (:results (value :scs ,scs)) @@ -652,10 +652,10 @@ (:translate data-vector-set-with-offset) (:policy :fast-safe) (:args (object :scs (descriptor-reg) :to (:eval 0)) - (index :scs (unsigned-reg immediate) :to (:eval 0)) + (index :scs (signed-reg immediate) :to (:eval 0)) (value :scs ,scs :target eax)) (:info offset) - (:arg-types ,ptype positive-fixnum + (:arg-types ,ptype tagged-num (:constant (constant-displacement other-pointer-lowtag 2 vector-data-offset)) ,element-type) @@ -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)))