- (:note "inline array store")
- (:translate data-vector-set)
- (:policy :fast-safe)
- (:args (object :scs (descriptor-reg))
- (index :scs (unsigned-reg) :target shift)
- (value :scs (unsigned-reg zero immediate) :target result))
- (:arg-types ,type positive-fixnum positive-fixnum)
- (:results (result :scs (unsigned-reg)))
- (:result-types positive-fixnum)
- (:temporary (:scs (interior-reg)) lip)
- (:temporary (:scs (non-descriptor-reg)) temp old)
- (:temporary (:scs (non-descriptor-reg) :from (:argument 1)) shift)
- (:generator 25
- (inst srl temp index ,bit-shift)
- (inst sll temp 2)
- (inst addu lip object temp)
- (inst lw old lip
- (- (* vector-data-offset n-word-bytes)
- other-pointer-lowtag))
- (inst and shift index ,(1- elements-per-word))
- ,@(when (eq *backend-byte-order* :big-endian)
- `((inst xor shift ,(1- elements-per-word))))
- ,@(unless (= bits 1)
- `((inst sll shift ,(1- (integer-length bits)))))
- (unless (and (sc-is value immediate)
- (= (tn-value value) ,(1- (ash 1 bits))))
- (inst li temp ,(1- (ash 1 bits)))
- (inst sll temp shift)
- (inst nor temp temp zero-tn)
- (inst and old temp))
- (unless (sc-is value zero)
- (sc-case value
- (immediate
- (inst li temp (logand (tn-value value) ,(1- (ash 1 bits)))))
- (unsigned-reg
- (inst and temp value ,(1- (ash 1 bits)))))
- (inst sll temp shift)
- (inst or old temp))
- (inst sw old lip
- (- (* vector-data-offset n-word-bytes)
- other-pointer-lowtag))
- (sc-case value
- (immediate
- (inst li result (tn-value value)))
- (zero
- (move result zero-tn))
- (unsigned-reg
- (move result value)))))
+ (:note "inline array store")
+ (:translate data-vector-set)
+ (:policy :fast-safe)
+ (:args (object :scs (descriptor-reg))
+ (index :scs (unsigned-reg) :target shift)
+ (value :scs (unsigned-reg zero immediate) :target result))
+ (:arg-types ,type positive-fixnum positive-fixnum)
+ (:results (result :scs (unsigned-reg)))
+ (:result-types positive-fixnum)
+ (:temporary (:scs (interior-reg)) lip)
+ (:temporary (:scs (non-descriptor-reg)) temp old)
+ (:temporary (:scs (non-descriptor-reg) :from (:argument 1)) shift)
+ (:generator 25
+ (inst srl temp index ,bit-shift)
+ (inst sll temp n-fixnum-tag-bits)
+ (inst addu lip object temp)
+ (inst lw old lip
+ (- (* vector-data-offset n-word-bytes)
+ other-pointer-lowtag))
+ (inst and shift index ,(1- elements-per-word))
+ ,@(when (eq *backend-byte-order* :big-endian)
+ `((inst xor shift ,(1- elements-per-word))))
+ ,@(unless (= bits 1)
+ `((inst sll shift ,(1- (integer-length bits)))))
+ (unless (and (sc-is value immediate)
+ (= (tn-value value) ,(1- (ash 1 bits))))
+ (inst li temp ,(1- (ash 1 bits)))
+ (inst sll temp shift)
+ (inst nor temp temp zero-tn)
+ (inst and old temp))
+ (unless (sc-is value zero)
+ (sc-case value
+ (immediate
+ (inst li temp (logand (tn-value value) ,(1- (ash 1 bits)))))
+ (unsigned-reg
+ (inst and temp value ,(1- (ash 1 bits)))))
+ (inst sll temp shift)
+ (inst or old temp))
+ (inst sw old lip
+ (- (* vector-data-offset n-word-bytes)
+ other-pointer-lowtag))
+ (sc-case value
+ (immediate
+ (inst li result (tn-value value)))
+ (zero
+ (move result zero-tn))
+ (unsigned-reg
+ (move result value)))))