(inst addi ndescr rank (fixnumize (1- array-dimensions-offset)))
(inst slwi ndescr ndescr n-widetag-bits)
(inst or ndescr ndescr type)
- (inst srwi ndescr ndescr 2)
+ (inst srwi ndescr ndescr n-fixnum-tag-bits)
(storew ndescr header 0 other-pointer-lowtag))
(move result header)))
(loadw temp x 0 other-pointer-lowtag)
(inst srawi temp temp n-widetag-bits)
(inst subi temp temp (1- array-dimensions-offset))
- (inst slwi res temp 2)))
+ (inst slwi res temp n-fixnum-tag-bits)))
\f
;;;; Bounds checking routine.
(:result-types positive-fixnum)
(:temporary (:scs (non-descriptor-reg) :to (:result 0)) temp result)
(:generator 20
- (inst srwi temp index ,bit-shift)
- (inst slwi temp temp 2)
+ ;; temp = (index >> bit-shift) << 2)
+ (inst rlwinm temp index ,(- 32 (- bit-shift 2)) ,(- bit-shift 2) 29)
(inst addi temp temp (- (* vector-data-offset n-word-bytes)
other-pointer-lowtag))
(inst lwzx result object temp)
`((inst slwi temp temp ,(1- (integer-length bits)))))
(inst srw result result temp)
(inst andi. result result ,(1- (ash 1 bits)))
- (inst slwi value result 2)))
+ (inst slwi value result n-fixnum-tag-bits)))
(define-vop (,(symbolicate 'data-vector-ref-c/ type))
(:translate data-vector-ref)
(:policy :fast-safe)
(:temporary (:scs (non-descriptor-reg)) temp old offset)
(:temporary (:scs (non-descriptor-reg) :from (:argument 1)) shift)
(:generator 25
- (inst srwi offset index ,bit-shift)
- (inst slwi offset offset 2)
+ ;; offset = (index >> bit-shift) << 2)
+ (inst rlwinm offset index ,(- 32 (- bit-shift 2)) ,(- bit-shift 2) 29)
(inst addi offset offset (- (* vector-data-offset n-word-bytes)
other-pointer-lowtag))
(inst lwzx old object offset)
(= (tn-value value) ,(1- (ash 1 bits))))
(inst lr temp ,(1- (ash 1 bits)))
(inst slw temp temp shift)
- (inst not temp temp)
- (inst and old old temp))
+ (inst andc old old temp))
(unless (sc-is value zero)
(sc-case value
(immediate
(unless (and (sc-is value immediate)
(= (tn-value value) ,(1- (ash 1 bits))))
(cond ((zerop extra)
- (inst slwi old old ,bits)
- (inst srwi old old ,bits))
+ (clrlwi old old ,bits))
(t
(inst lr temp
(lognot (ash ,(1- (ash 1 bits))
;; it is a fixnum. The lowtag selection magic that is required to
;; ensure this is explained in the comment in objdef.lisp
(loadw res symbol symbol-hash-slot other-pointer-lowtag)
- (inst clrrwi res res (1- n-lowtag-bits))))
+ (inst clrrwi res res n-fixnum-tag-bits)))
\f
;;;; Fdefinition (fdefn) objects.
(:result-types unsigned-num)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:result-types unsigned-num)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:result-types single-float)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:result-types double-float)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:result-types complex-single-float)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:result-types complex-double-float)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
- (inst srwi offset offset n-widetag-bits)
- (inst slwi offset offset 2)
+ ;; offset = (offset >> n-widetag-bits) << 2
+ (inst rlwinm offset offset (- 32 (- n-widetag-bits 2)) (- n-widetag-bits 2) 29)
(inst subf offset index offset)
(inst addi
offset