(define-vop (set-slot)
(:args (object :scs (descriptor-reg))
- (value :scs (descriptor-reg any-reg null zero)))
+ (value :scs (descriptor-reg any-reg null zero)))
(:info name offset lowtag)
(:ignore name)
(:results)
(loadw value obj-temp symbol-value-slot other-pointer-lowtag)
(let ((err-lab (generate-error-code vop unbound-symbol-error obj-temp)))
(inst xor temp value unbound-marker-widetag)
- (inst beq temp zero-tn err-lab)
+ (inst beq temp err-lab)
(inst nop))))
;;; Like CHECKED-CELL-REF, only we are a predicate to see if the cell is bound.
(loadw value object symbol-value-slot other-pointer-lowtag)
(inst xor temp value unbound-marker-widetag)
(if not-p
- (inst beq temp zero-tn target)
- (inst bne temp zero-tn target))
+ (inst beq temp target)
+ (inst bne temp target))
(inst nop)))
(define-vop (fast-symbol-value cell-ref)
(:policy :fast-safe)
(:translate symbol-hash)
(:args (symbol :scs (descriptor-reg)))
+ (:temporary (:scs (non-descriptor-reg)) temp)
(:results (res :scs (any-reg)))
(:result-types positive-fixnum)
- (:temporary (:scs (any-reg)) temp)
(:generator 2
;; The symbol-hash slot of NIL holds NIL because it is also the
;; cdr slot, so we have to strip off the two low bits to make sure
;; it is a fixnum. The lowtag selection magic that is required to
;; ensure this is explained in the comment in objdef.lisp
- ;;
- ;; wow, MIPS sucks (or I do) -- CSR, 2004-05-20
- (inst li temp (fixnumize -1))
- (loadw res symbol symbol-hash-slot other-pointer-lowtag)
- (inst and res temp)))
+ (loadw temp symbol symbol-hash-slot other-pointer-lowtag)
+ (inst srl temp n-fixnum-tag-bits)
+ (inst sll res temp n-fixnum-tag-bits)))
\f
;;;; Fdefinition (fdefn) objects.
(:policy :fast-safe)
(:translate (setf fdefn-fun))
(:args (function :scs (descriptor-reg) :target result)
- (fdefn :scs (descriptor-reg)))
+ (fdefn :scs (descriptor-reg)))
(:temporary (:scs (interior-reg)) lip)
(:temporary (:scs (non-descriptor-reg)) type)
(:results (result :scs (descriptor-reg)))
(load-type type function (- fun-pointer-lowtag))
(inst nop)
(inst xor type simple-fun-header-widetag)
- (inst beq type zero-tn normal-fn)
+ (inst beq type normal-fn)
(inst addu lip function
- (- (ash simple-fun-code-offset word-shift)
- fun-pointer-lowtag))
+ (- (ash simple-fun-code-offset word-shift)
+ fun-pointer-lowtag))
(inst li lip (make-fixup "closure_tramp" :foreign))
(emit-label normal-fn)
(storew lip fdefn fdefn-raw-addr-slot other-pointer-lowtag)
(define-vop (bind)
(:args (val :scs (any-reg descriptor-reg))
- (symbol :scs (descriptor-reg)))
+ (symbol :scs (descriptor-reg)))
(:temporary (:scs (descriptor-reg)) temp)
(:generator 5
(loadw temp symbol symbol-value-slot other-pointer-lowtag)
(loadw value bsp-tn (- binding-value-slot binding-size))
(storew value symbol symbol-value-slot other-pointer-lowtag)
(storew zero-tn bsp-tn (- binding-symbol-slot binding-size))
+ (storew zero-tn bsp-tn (- binding-value-slot binding-size))
(inst addu bsp-tn bsp-tn (* -2 n-word-bytes))))
(:temporary (:scs (descriptor-reg)) symbol value)
(:generator 0
(let ((loop (gen-label))
- (skip (gen-label))
- (done (gen-label)))
+ (skip (gen-label))
+ (done (gen-label)))
(move where arg)
(inst beq where bsp-tn done)
(inst nop)
(emit-label loop)
(loadw symbol bsp-tn (- binding-symbol-slot binding-size))
- (inst beq symbol zero-tn skip)
+ (inst beq symbol skip)
(loadw value bsp-tn (- binding-value-slot binding-size))
(storew value symbol symbol-value-slot other-pointer-lowtag)
(storew zero-tn bsp-tn (- binding-symbol-slot binding-size))
(emit-label skip)
+ (storew zero-tn bsp-tn (- binding-value-slot binding-size))
(inst addu bsp-tn bsp-tn (* -2 n-word-bytes))
(inst bne where bsp-tn loop)
(inst nop)
funcallable-instance-info-offset fun-pointer-lowtag
(descriptor-reg any-reg) * %funcallable-instance-info)
-(define-vop (funcallable-instance-lexenv cell-ref)
- (:variant funcallable-instance-lexenv-slot fun-pointer-lowtag))
-
(define-vop (closure-ref slot-ref)
(:variant closure-info-offset fun-pointer-lowtag))
(define-vop (closure-init slot-set)
(:variant closure-info-offset fun-pointer-lowtag))
-
\f
;;;; Value Cell hackery.
(:policy :fast-safe)
(:translate %instance-length)
(:args (struct :scs (descriptor-reg)))
+ (:temporary (:scs (non-descriptor-reg)) temp)
(:results (res :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 4
- (loadw res struct 0 instance-pointer-lowtag)
- (inst srl res n-widetag-bits)))
-
-(define-vop (instance-ref slot-ref)
- (:variant instance-slots-offset instance-pointer-lowtag)
- (:policy :fast-safe)
- (:translate %instance-ref)
- (:arg-types instance (:constant index)))
-
-#+nil
-(define-vop (instance-set slot-set)
- (:policy :fast-safe)
- (:translate %instance-set)
- (:variant instance-slots-offset instance-pointer-lowtag)
- (:arg-types instance (:constant index) *))
+ (loadw temp struct 0 instance-pointer-lowtag)
+ (inst srl res temp n-widetag-bits)))
(define-full-reffer instance-index-ref * instance-slots-offset
instance-pointer-lowtag (descriptor-reg any-reg) * %instance-ref)
(:translate %raw-instance-ref/word)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg)))
+ (index :scs (any-reg)))
(:arg-types * positive-fixnum)
(:results (value :scs (unsigned-reg)))
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset n-word-bytes)
(inst addu lip offset object)
(inst lw value lip (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag))))
+ instance-pointer-lowtag))))
(define-vop (raw-instance-set/word)
(:translate %raw-instance-set/word)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg))
+ (index :scs (any-reg))
(value :scs (unsigned-reg) :target result))
(:arg-types * positive-fixnum unsigned-num)
(:results (result :scs (unsigned-reg)))
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset n-word-bytes)
(inst addu lip offset object)
(inst sw value lip (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag))
- (unless (location= result value)
- (move result value))))
+ instance-pointer-lowtag))
+ (move result value)))
(define-vop (raw-instance-ref/single)
(:translate %raw-instance-ref/single)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg)))
+ (index :scs (any-reg)))
(:arg-types * positive-fixnum)
(:results (value :scs (single-reg)))
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset n-word-bytes)
(inst addu lip offset object)
(inst lwc1 value lip (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag))))
+ instance-pointer-lowtag))))
(define-vop (raw-instance-set/single)
(:translate %raw-instance-set/single)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg))
+ (index :scs (any-reg))
(value :scs (single-reg) :target result))
(:arg-types * positive-fixnum single-float)
(:results (result :scs (single-reg)))
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset n-word-bytes)
(inst addu lip offset object)
(inst swc1 value lip (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag))
+ instance-pointer-lowtag))
(unless (location= result value)
(inst fmove :single result value))))
(:translate %raw-instance-ref/double)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg)))
+ (index :scs (any-reg)))
(:arg-types * positive-fixnum)
(:results (value :scs (double-reg)))
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset (* 2 n-word-bytes))
(inst addu lip offset object)
(let ((immediate-offset (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst lwc1 value lip immediate-offset))
- (:little-endian (inst lwc1-odd value lip immediate-offset))))
+ (:big-endian (inst lwc1 value lip immediate-offset))
+ (:little-endian (inst lwc1-odd value lip immediate-offset))))
(let ((immediate-offset (- (* (1+ instance-slots-offset) n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst lwc1-odd value lip immediate-offset))
- (:little-endian (inst lwc1 value lip immediate-offset))))))
+ (:big-endian (inst lwc1-odd value lip immediate-offset))
+ (:little-endian (inst lwc1 value lip immediate-offset))))))
(define-vop (raw-instance-set/double)
(:translate %raw-instance-set/double)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg))
+ (index :scs (any-reg))
(value :scs (double-reg) :target result))
(:arg-types * positive-fixnum double-float)
(:results (result :scs (double-reg)))
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset (* 2 n-word-bytes))
(inst addu lip offset object)
(let ((immediate-offset (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst swc1 value lip immediate-offset))
- (:little-endian (inst swc1-odd value lip immediate-offset))))
+ (:big-endian (inst swc1 value lip immediate-offset))
+ (:little-endian (inst swc1-odd value lip immediate-offset))))
(let ((immediate-offset (- (* (1+ instance-slots-offset) n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst swc1-odd value lip immediate-offset))
- (:little-endian (inst swc1 value lip immediate-offset))))
+ (:big-endian (inst swc1-odd value lip immediate-offset))
+ (:little-endian (inst swc1 value lip immediate-offset))))
(unless (location= result value)
(inst fmove :double result value))))
(:translate %raw-instance-ref/complex-single)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg)))
+ (index :scs (any-reg)))
(:arg-types * positive-fixnum)
(:results (value :scs (complex-single-reg)))
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset (* 2 n-word-bytes))
(inst addu lip offset object)
- (inst lwc1
- (complex-single-reg-real-tn value)
- lip
- (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag))
(inst lwc1
- (complex-single-reg-imag-tn value)
- lip
- (- (* (1+ instance-slots-offset) n-word-bytes)
+ (complex-single-reg-real-tn value)
+ lip
+ (- (* instance-slots-offset n-word-bytes)
+ instance-pointer-lowtag))
+ (inst lwc1
+ (complex-single-reg-imag-tn value)
+ lip
+ (- (* (1+ instance-slots-offset) n-word-bytes)
instance-pointer-lowtag))))
(define-vop (raw-instance-set/complex-single)
(:translate %raw-instance-set/complex-single)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg))
+ (index :scs (any-reg))
(value :scs (complex-single-reg) :target result))
(:arg-types * positive-fixnum complex-single-float)
(:results (result :scs (complex-single-reg)))
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset (* 2 n-word-bytes))
(inst addu lip offset object)
(let ((value-real (complex-single-reg-real-tn value))
(result-real (complex-single-reg-real-tn result)))
(inst swc1
- value-real
+ value-real
lip
- (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag))
+ (- (* instance-slots-offset n-word-bytes)
+ instance-pointer-lowtag))
(unless (location= result-real value-real)
- (inst fmove :single result-real value-real)))
+ (inst fmove :single result-real value-real)))
(let ((value-imag (complex-single-reg-imag-tn value))
(result-imag (complex-single-reg-imag-tn result)))
(inst swc1
- value-imag
+ value-imag
lip
- (- (* (1+ instance-slots-offset) n-word-bytes)
- instance-pointer-lowtag))
+ (- (* (1+ instance-slots-offset) n-word-bytes)
+ instance-pointer-lowtag))
(unless (location= result-imag value-imag)
- (inst fmove :single result-imag value-imag)))))
+ (inst fmove :single result-imag value-imag)))))
(define-vop (raw-instance-ref/complex-double)
(:translate %raw-instance-ref/complex-double)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg)))
+ (index :scs (any-reg)))
(:arg-types * positive-fixnum)
(:results (value :scs (complex-double-reg)))
(:temporary (:scs (non-descriptor-reg)) offset)
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset (* 4 n-word-bytes))
(inst addu lip offset object)
(let ((immediate-offset (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst lwc1
- (complex-double-reg-real-tn value)
- lip
- immediate-offset))
- (:little-endian (inst lwc1-odd
- (complex-double-reg-real-tn value)
- lip
- immediate-offset))))
+ (:big-endian (inst lwc1
+ (complex-double-reg-real-tn value)
+ lip
+ immediate-offset))
+ (:little-endian (inst lwc1-odd
+ (complex-double-reg-real-tn value)
+ lip
+ immediate-offset))))
(let ((immediate-offset (- (* (1+ instance-slots-offset) n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst lwc1-odd
- (complex-double-reg-real-tn value)
- lip
- immediate-offset))
- (:little-endian (inst lwc1
- (complex-double-reg-real-tn value)
- lip
- immediate-offset))))
+ (:big-endian (inst lwc1-odd
+ (complex-double-reg-real-tn value)
+ lip
+ immediate-offset))
+ (:little-endian (inst lwc1
+ (complex-double-reg-real-tn value)
+ lip
+ immediate-offset))))
(let ((immediate-offset (- (* (+ instance-slots-offset 2) n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst lwc1
- (complex-double-reg-imag-tn value)
- lip
- immediate-offset))
- (:little-endian (inst lwc1-odd
- (complex-double-reg-imag-tn value)
- lip
- immediate-offset))))
+ (:big-endian (inst lwc1
+ (complex-double-reg-imag-tn value)
+ lip
+ immediate-offset))
+ (:little-endian (inst lwc1-odd
+ (complex-double-reg-imag-tn value)
+ lip
+ immediate-offset))))
(let ((immediate-offset (- (* (+ instance-slots-offset 3) n-word-bytes)
- instance-pointer-lowtag)))
+ instance-pointer-lowtag)))
(ecase *backend-byte-order*
- (:big-endian (inst lwc1-odd
- (complex-double-reg-imag-tn value)
- lip
- immediate-offset))
- (:little-endian (inst lwc1
- (complex-double-reg-imag-tn value)
- lip
- immediate-offset))))))
+ (:big-endian (inst lwc1-odd
+ (complex-double-reg-imag-tn value)
+ lip
+ immediate-offset))
+ (:little-endian (inst lwc1
+ (complex-double-reg-imag-tn value)
+ lip
+ immediate-offset))))))
(define-vop (raw-instance-set/complex-double)
(:translate %raw-instance-set/complex-double)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
- (index :scs (any-reg))
+ (index :scs (any-reg))
(value :scs (complex-double-reg) :target result))
(:arg-types * positive-fixnum complex-double-float)
(:results (result :scs (complex-double-reg)))
(:generator 5
(loadw offset object 0 instance-pointer-lowtag)
(inst srl offset n-widetag-bits)
- (inst sll offset 2)
+ (inst sll offset n-fixnum-tag-bits)
(inst subu offset index)
(inst subu offset (* 4 n-word-bytes))
(inst addu lip offset object)
(let ((value-real (complex-double-reg-real-tn value))
(result-real (complex-double-reg-real-tn result)))
(let ((immediate-offset (- (* instance-slots-offset n-word-bytes)
- instance-pointer-lowtag)))
- (ecase *backend-byte-order*
- (:big-endian (inst swc1
- value-real
- lip
- immediate-offset))
- (:little-endian (inst swc1-odd
- value-real
- lip
- immediate-offset))))
+ instance-pointer-lowtag)))
+ (ecase *backend-byte-order*
+ (:big-endian (inst swc1
+ value-real
+ lip
+ immediate-offset))
+ (:little-endian (inst swc1-odd
+ value-real
+ lip
+ immediate-offset))))
(let ((immediate-offset (- (* (1+ instance-slots-offset) n-word-bytes)
- instance-pointer-lowtag)))
- (ecase *backend-byte-order*
- (:big-endian (inst swc1-odd
- value-real
- lip
- immediate-offset))
- (:little-endian (inst swc1
- value-real
- lip
- immediate-offset))))
+ instance-pointer-lowtag)))
+ (ecase *backend-byte-order*
+ (:big-endian (inst swc1-odd
+ value-real
+ lip
+ immediate-offset))
+ (:little-endian (inst swc1
+ value-real
+ lip
+ immediate-offset))))
(unless (location= result-real value-real)
- (inst fmove :double result-real value-real)))
+ (inst fmove :double result-real value-real)))
(let ((value-imag (complex-double-reg-imag-tn value))
(result-imag (complex-double-reg-imag-tn result)))
(let ((immediate-offset (- (* (+ instance-slots-offset 2) n-word-bytes)
- instance-pointer-lowtag)))
- (ecase *backend-byte-order*
- (:big-endian (inst swc1
- value-imag
- lip
- immediate-offset))
- (:little-endian (inst swc1-odd
- value-imag
- lip
- immediate-offset))))
+ instance-pointer-lowtag)))
+ (ecase *backend-byte-order*
+ (:big-endian (inst swc1
+ value-imag
+ lip
+ immediate-offset))
+ (:little-endian (inst swc1-odd
+ value-imag
+ lip
+ immediate-offset))))
(let ((immediate-offset (- (* (+ instance-slots-offset 3) n-word-bytes)
- instance-pointer-lowtag)))
- (ecase *backend-byte-order*
- (:big-endian (inst swc1-odd
- value-imag
- lip
- immediate-offset))
- (:little-endian (inst swc1
- value-imag
- lip
- immediate-offset))))
+ instance-pointer-lowtag)))
+ (ecase *backend-byte-order*
+ (:big-endian (inst swc1-odd
+ value-imag
+ lip
+ immediate-offset))
+ (:little-endian (inst swc1
+ value-imag
+ lip
+ immediate-offset))))
(unless (location= result-imag value-imag)
- (inst fmove :double result-imag value-imag)))))
+ (inst fmove :double result-imag value-imag)))))