X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fppc%2Fcell.lisp;h=d44dc85971c337d432afb0cce70aa8df20f50e91;hb=c49d74c70beef5fb0c8774a571b7c074aba9b851;hp=d1dc08600b0026078adae011d519cd534520fa36;hpb=f3f677703e37f5a335b3be7fa64f7748ad969517;p=sbcl.git diff --git a/src/compiler/ppc/cell.lisp b/src/compiler/ppc/cell.lisp index d1dc086..d44dc85 100644 --- a/src/compiler/ppc/cell.lisp +++ b/src/compiler/ppc/cell.lisp @@ -24,7 +24,7 @@ (define-vop (set-slot) (:args (object :scs (descriptor-reg)) - (value :scs (descriptor-reg any-reg))) + (value :scs (descriptor-reg any-reg))) (:info name offset lowtag) (:ignore name) (:results) @@ -91,7 +91,7 @@ ;; 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))) ;;;; Fdefinition (fdefn) objects. @@ -115,7 +115,7 @@ (: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))) @@ -125,7 +125,7 @@ (inst cmpwi type simple-fun-header-widetag) ;;(inst mr lip function) (inst addi lip function - (- (ash simple-fun-code-offset word-shift) fun-pointer-lowtag)) + (- (ash simple-fun-code-offset word-shift) fun-pointer-lowtag)) (inst beq normal-fn) (inst lr lip (make-fixup "closure_tramp" :foreign)) (emit-label normal-fn) @@ -155,7 +155,7 @@ (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) @@ -172,6 +172,7 @@ (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 subi bsp-tn bsp-tn (* 2 n-word-bytes)))) @@ -181,8 +182,8 @@ (: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 cmpw where bsp-tn) (inst beq done) @@ -196,6 +197,7 @@ (storew zero-tn bsp-tn (- binding-symbol-slot binding-size)) (emit-label skip) + (storew zero-tn bsp-tn (- binding-value-slot binding-size)) (inst subi bsp-tn bsp-tn (* 2 n-word-bytes)) (inst cmpw where bsp-tn) (inst bne loop) @@ -218,10 +220,6 @@ (:variant funcallable-instance-info-offset fun-pointer-lowtag) (:translate %set-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)) @@ -252,27 +250,14 @@ (loadw temp struct 0 instance-pointer-lowtag) (inst srwi res temp n-widetag-bits))) -(define-vop (instance-ref slot-ref) - (:variant instance-slots-offset instance-pointer-lowtag) - (:policy :fast-safe) - (:translate %instance-ref) - (:arg-types * (: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) *)) - (define-vop (instance-index-ref word-index-ref) - (:policy :fast-safe) + (:policy :fast-safe) (:translate %instance-ref) (:variant instance-slots-offset instance-pointer-lowtag) (:arg-types instance positive-fixnum)) (define-vop (instance-index-set word-index-set) - (:policy :fast-safe) + (:policy :fast-safe) (:translate %instance-set) (:variant instance-slots-offset instance-pointer-lowtag) (:arg-types instance positive-fixnum *)) @@ -300,15 +285,15 @@ (: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) (: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 @@ -321,7 +306,7 @@ (: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))) (:arg-types * positive-fixnum unsigned-num) (:results (result :scs (unsigned-reg))) @@ -329,8 +314,8 @@ (: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 @@ -344,15 +329,15 @@ (: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) (: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 @@ -365,16 +350,16 @@ (:translate %raw-instance-set/single) (:policy :fast-safe) (:args (object :scs (descriptor-reg)) - (index :scs (any-reg)) - (value :scs (single-reg) :target result)) + (index :scs (any-reg)) + (value :scs (single-reg) :target result)) (:arg-types * positive-fixnum single-float) (:results (result :scs (single-reg))) (:result-types single-float) (: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 @@ -389,15 +374,15 @@ (: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) (: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 @@ -410,16 +395,16 @@ (:translate %raw-instance-set/double) (:policy :fast-safe) (:args (object :scs (descriptor-reg)) - (index :scs (any-reg)) - (value :scs (double-reg) :target result)) + (index :scs (any-reg)) + (value :scs (double-reg) :target result)) (:arg-types * positive-fixnum double-float) (:results (result :scs (double-reg))) (:result-types double-float) (: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 @@ -434,15 +419,15 @@ (: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) (: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 @@ -457,16 +442,16 @@ (:translate %raw-instance-set/complex-single) (:policy :fast-safe) (:args (object :scs (descriptor-reg)) - (index :scs (any-reg)) - (value :scs (complex-single-reg) :target result)) + (index :scs (any-reg)) + (value :scs (complex-single-reg) :target result)) (:arg-types * positive-fixnum complex-single-float) (:results (result :scs (complex-single-reg))) (:result-types complex-single-float) (: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 @@ -474,13 +459,13 @@ (- (* (- instance-slots-offset 2) n-word-bytes) instance-pointer-lowtag)) (let ((value-real (complex-single-reg-real-tn value)) - (result-real (complex-single-reg-real-tn result))) + (result-real (complex-single-reg-real-tn result))) (inst stfsx value-real object offset) (unless (location= result-real value-real) (inst frsp result-real value-real))) (inst addi offset offset n-word-bytes) (let ((value-imag (complex-single-reg-imag-tn value)) - (result-imag (complex-single-reg-imag-tn result))) + (result-imag (complex-single-reg-imag-tn result))) (inst stfsx value-imag object offset) (unless (location= result-imag value-imag) (inst frsp result-imag value-imag))))) @@ -489,15 +474,15 @@ (: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) (: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 @@ -512,16 +497,16 @@ (:translate %raw-instance-set/complex-double) (:policy :fast-safe) (:args (object :scs (descriptor-reg)) - (index :scs (any-reg)) - (value :scs (complex-double-reg) :target result)) + (index :scs (any-reg)) + (value :scs (complex-double-reg) :target result)) (:arg-types * positive-fixnum complex-double-float) (:results (result :scs (complex-double-reg))) (:result-types complex-double-float) (: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 @@ -529,13 +514,13 @@ (- (* (- instance-slots-offset 4) n-word-bytes) instance-pointer-lowtag)) (let ((value-real (complex-double-reg-real-tn value)) - (result-real (complex-double-reg-real-tn result))) + (result-real (complex-double-reg-real-tn result))) (inst stfdx value-real object offset) (unless (location= result-real value-real) (inst fmr result-real value-real))) (inst addi offset offset (* 2 n-word-bytes)) (let ((value-imag (complex-double-reg-imag-tn value)) - (result-imag (complex-double-reg-imag-tn result))) + (result-imag (complex-double-reg-imag-tn result))) (inst stfdx value-imag object offset) (unless (location= result-imag value-imag) (inst fmr result-imag value-imag)))))