- (:note "inline array store")
- (:translate data-vector-set)
- (:policy :fast-safe)
- (:args (object :scs (descriptor-reg) :target ptr)
- (index :scs (unsigned-reg) :target ecx)
- (value :scs (unsigned-reg immediate) :target result))
- (:arg-types ,type positive-fixnum positive-fixnum)
- (:results (result :scs (unsigned-reg)))
- (:result-types positive-fixnum)
- (:temporary (:sc unsigned-reg) word-index)
- (:temporary (:sc unsigned-reg :from (:argument 0)) ptr old)
- (:temporary (:sc unsigned-reg :offset ecx-offset :from (:argument 1))
- ecx)
- (:generator 25
- (move word-index index)
- (inst shr word-index ,bit-shift)
- (inst lea ptr
- (make-ea :dword :base object :index word-index :scale 4
- :disp (- (* vector-data-offset n-word-bytes)
- other-pointer-lowtag)))
- (loadw old ptr)
- (move ecx index)
- (inst and ecx ,(1- elements-per-word))
- ,@(unless (= bits 1)
- `((inst shl ecx ,(1- (integer-length bits)))))
- (inst ror old :cl)
- (unless (and (sc-is value immediate)
- (= (tn-value value) ,(1- (ash 1 bits))))
- (inst and old ,(lognot (1- (ash 1 bits)))))
- (sc-case value
- (immediate
- (unless (zerop (tn-value value))
- (inst or old (logand (tn-value value) ,(1- (ash 1 bits))))))
- (unsigned-reg
- (inst or old value)))
- (inst rol old :cl)
- (storew old ptr)
- (sc-case value
- (immediate
- (inst mov result (tn-value value)))
- (unsigned-reg
- (move result value)))))
+ (:note "inline array store")
+ (:translate data-vector-set)
+ (:policy :fast-safe)
+ (:args (object :scs (descriptor-reg) :target ptr)
+ (index :scs (unsigned-reg) :target ecx)
+ (value :scs (unsigned-reg immediate) :target result))
+ (:arg-types ,type positive-fixnum positive-fixnum)
+ (:results (result :scs (unsigned-reg)))
+ (:result-types positive-fixnum)
+ (:temporary (:sc unsigned-reg) word-index)
+ (:temporary (:sc unsigned-reg :from (:argument 0)) ptr old)
+ (:temporary (:sc unsigned-reg :offset ecx-offset :from (:argument 1))
+ ecx)
+ (:generator 25
+ (move word-index index)
+ (inst shr word-index ,bit-shift)
+ (inst lea ptr
+ (make-ea :dword :base object :index word-index :scale 4
+ :disp (- (* vector-data-offset n-word-bytes)
+ other-pointer-lowtag)))
+ (loadw old ptr)
+ (move ecx index)
+ (inst and ecx ,(1- elements-per-word))
+ ,@(unless (= bits 1)
+ `((inst shl ecx ,(1- (integer-length bits)))))
+ (inst ror old :cl)
+ (unless (and (sc-is value immediate)
+ (= (tn-value value) ,(1- (ash 1 bits))))
+ (inst and old ,(lognot (1- (ash 1 bits)))))
+ (sc-case value
+ (immediate
+ (unless (zerop (tn-value value))
+ (inst or old (logand (tn-value value) ,(1- (ash 1 bits))))))
+ (unsigned-reg
+ (inst or old value)))
+ (inst rol old :cl)
+ (storew old ptr)
+ (sc-case value
+ (immediate
+ (inst mov result (tn-value value)))
+ (unsigned-reg
+ (move result value)))))