- (inst lea result (make-ea :byte :base words :disp
- (+ (1- (ash 1 n-lowtag-bits))
- (* vector-data-offset n-word-bytes))))
- (inst and result (lognot lowtag-mask))
- ;; FIXME: It would be good to check for stack overflow here.
- (move ecx words)
- (inst shr ecx n-fixnum-tag-bits)
- (allocation result result node t)
- (inst cld)
- (inst lea res
- (make-ea :byte :base result :disp (* vector-data-offset n-word-bytes)))
- (inst lea result (make-ea :byte :base result :disp other-pointer-lowtag))
- (sc-case type
- (immediate
- (aver (typep (tn-value type) '(unsigned-byte 8)))
- (storeb (tn-value type) result 0 other-pointer-lowtag))
- (t
- (storew type result 0 other-pointer-lowtag)))
- (storew length result vector-length-slot other-pointer-lowtag)
- (inst xor zero zero)
- (inst rep)
- (inst stos zero)))
+ (let ((unboxed-elements-p (and (sc-is type immediate)
+ (/= (tn-value type)
+ simple-vector-widetag))))
+ (inst lea result (make-ea :byte :base words :disp
+ (+ (1- (ash 1 n-lowtag-bits))
+ (* vector-data-offset n-word-bytes))))
+ (inst and result (lognot lowtag-mask))
+ ;; FIXME: It would be good to check for stack overflow here.
+ (move ecx words)
+ (inst shr ecx n-fixnum-tag-bits)
+ (allocation result result node t)
+ (unless unboxed-elements-p
+ (inst cld))
+ (inst lea res
+ (make-ea :byte :base result :disp (* vector-data-offset n-word-bytes)))
+ (inst lea result (make-ea :byte :base result :disp other-pointer-lowtag))
+ (sc-case type
+ (immediate
+ (aver (typep (tn-value type) '(unsigned-byte 8)))
+ (storeb (tn-value type) result 0 other-pointer-lowtag))
+ (t
+ (storew type result 0 other-pointer-lowtag)))
+ (storew length result vector-length-slot other-pointer-lowtag)
+ (unless unboxed-elements-p
+ (inst xor zero zero)
+ (inst rep)
+ (inst stos zero)))))