From: Nathan Froyd Date: Mon, 3 Oct 2005 18:53:41 +0000 (+0000) Subject: 0.9.5.19: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=03fdcf4cd8f7551759c64c83144c11f423f4e6b6;p=sbcl.git 0.9.5.19: Micro-optimizations for PPC "small-data" array and raw slot vops. --- diff --git a/src/compiler/ppc/array.lisp b/src/compiler/ppc/array.lisp index 16b4f06..da3d649 100644 --- a/src/compiler/ppc/array.lisp +++ b/src/compiler/ppc/array.lisp @@ -33,7 +33,7 @@ (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))) @@ -59,7 +59,7 @@ (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))) ;;;; Bounds checking routine. @@ -156,8 +156,8 @@ (: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) @@ -167,7 +167,7 @@ `((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) @@ -206,8 +206,8 @@ (: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) @@ -219,8 +219,7 @@ (= (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 @@ -259,8 +258,7 @@ (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)) diff --git a/src/compiler/ppc/cell.lisp b/src/compiler/ppc/cell.lisp index ff16478..8dccc05 100644 --- a/src/compiler/ppc/cell.lisp +++ b/src/compiler/ppc/cell.lisp @@ -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. @@ -307,8 +307,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 @@ -329,8 +329,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 @@ -351,8 +351,8 @@ (: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 @@ -373,8 +373,8 @@ (: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 @@ -396,8 +396,8 @@ (: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 @@ -418,8 +418,8 @@ (: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 @@ -441,8 +441,8 @@ (: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 @@ -465,8 +465,8 @@ (: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 @@ -496,8 +496,8 @@ (: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 @@ -520,8 +520,8 @@ (: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 diff --git a/version.lisp-expr b/version.lisp-expr index 8c478a6..24a86dd 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.5.18" +"0.9.5.19"