X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Farray.lisp;h=7228e6ddb8fba93ba90926d06d29d9eadd103b6a;hb=670010e3f3dcd62efaf23f61abdc73950edb88c6;hp=a9b7b7977111e950c8cce434b0bf06bd4a0dfcdb;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/compiler/x86/array.lisp b/src/compiler/x86/array.lisp index a9b7b79..7228e6d 100644 --- a/src/compiler/x86/array.lisp +++ b/src/compiler/x86/array.lisp @@ -26,18 +26,18 @@ (:generator 13 (inst lea bytes (make-ea :dword :base rank - :disp (+ (* (1+ array-dimensions-offset) word-bytes) + :disp (+ (* (1+ array-dimensions-offset) n-word-bytes) lowtag-mask))) (inst and bytes (lognot lowtag-mask)) (inst lea header (make-ea :dword :base rank :disp (fixnumize (1- array-dimensions-offset)))) - (inst shl header type-bits) + (inst shl header n-widetag-bits) (inst or header type) (inst shr header 2) (pseudo-atomic (allocation result bytes node) - (inst lea result (make-ea :dword :base result :disp other-pointer-type)) - (storew header result 0 other-pointer-type)))) + (inst lea result (make-ea :dword :base result :disp other-pointer-lowtag)) + (storew header result 0 other-pointer-lowtag)))) ;;;; additional accessors and setters for the array header @@ -47,11 +47,11 @@ ()) (define-full-reffer %array-dimension * - array-dimensions-offset other-pointer-type + array-dimensions-offset other-pointer-lowtag (any-reg) positive-fixnum sb!impl::%array-dimension) (define-full-setter %set-array-dimension * - array-dimensions-offset other-pointer-type + array-dimensions-offset other-pointer-lowtag (any-reg) positive-fixnum sb!impl::%set-array-dimension) (defknown sb!impl::%array-rank (t) index (flushable)) @@ -63,8 +63,8 @@ (:results (res :scs (unsigned-reg))) (:result-types positive-fixnum) (:generator 6 - (loadw res x 0 other-pointer-type) - (inst shr res type-bits) + (loadw res x 0 other-pointer-lowtag) + (inst shr res n-widetag-bits) (inst sub res (1- array-dimensions-offset)))) ;;;; bounds checking routine @@ -72,6 +72,42 @@ ;;; Note that the immediate SC for the index argument is disabled ;;; because it is not possible to generate a valid error code SC for ;;; an immediate value. +;;; +;;; FIXME: As per the KLUDGE note explaining the :IGNORE-FAILURE-P +;;; flag in build-order.lisp-expr, compiling this file causes warnings +;;; Argument FOO to VOP CHECK-BOUND has SC restriction +;;; DESCRIPTOR-REG which is not allowed by the operand type: +;;; (:OR POSITIVE-FIXNUM) +;;; CSR's message "format ~/ /" on sbcl-devel 2002-03-12 contained +;;; a possible patch, described as +;;; Another patch is included more for information than anything -- +;;; removing the descriptor-reg SCs from the CHECK-BOUND vop in +;;; x86/array.lisp seems to allow that file to compile without error[*], +;;; and build; I haven't tested rebuilding capability, but I'd be +;;; surprised if there were a problem. I'm not certain that this is the +;;; correct fix, though, as the restrictions on the arguments to the VOP +;;; aren't the same as in the sparc and alpha ports, where, incidentally, +;;; the corresponding file builds without error currently. +;;; Since neither of us (CSR or WHN) was quite sure that this is the +;;; right thing, I've just recorded the patch here in hopes it might +;;; help when someone attacks this problem again: +;;; diff -u -r1.7 array.lisp +;;; --- src/compiler/x86/array.lisp 11 Oct 2001 14:05:26 -0000 1.7 +;;; +++ src/compiler/x86/array.lisp 12 Mar 2002 12:23:37 -0000 +;;; @@ -76,10 +76,10 @@ +;;; (:translate %check-bound) +;;; (:policy :fast-safe) +;;; (:args (array :scs (descriptor-reg)) +;;; - (bound :scs (any-reg descriptor-reg)) +;;; - (index :scs (any-reg descriptor-reg #+nil immediate) :target result)) +;;; + (bound :scs (any-reg)) +;;; + (index :scs (any-reg #+nil immediate) :target result)) +;;; (:arg-types * positive-fixnum tagged-num) +;;; - (:results (result :scs (any-reg descriptor-reg))) +;;; + (:results (result :scs (any-reg))) +;;; (:result-types positive-fixnum) +;;; (:vop-var vop) +;;; (:save-p :compute-only) (define-vop (check-bound) (:translate %check-bound) (:policy :fast-safe) @@ -105,10 +141,10 @@ (macrolet ((def-full-data-vector-frobs (type element-type &rest scs) `(progn (define-full-reffer ,(symbolicate "DATA-VECTOR-REF/" type) - ,type vector-data-offset other-pointer-type ,scs + ,type vector-data-offset other-pointer-lowtag ,scs ,element-type data-vector-ref) (define-full-setter ,(symbolicate "DATA-VECTOR-SET/" type) - ,type vector-data-offset other-pointer-type ,scs + ,type vector-data-offset other-pointer-lowtag ,scs ,element-type data-vector-set)))) (def-full-data-vector-frobs simple-vector * descriptor-reg any-reg) (def-full-data-vector-frobs simple-array-unsigned-byte-32 unsigned-num @@ -121,7 +157,7 @@ ;;;; bit, 2-bit, and 4-bit vectors (macrolet ((def-small-data-vector-frobs (type bits) - (let* ((elements-per-word (floor sb!vm:word-bits bits)) + (let* ((elements-per-word (floor sb!vm:n-word-bits bits)) (bit-shift (1- (integer-length elements-per-word)))) `(progn (define-vop (,(symbolicate 'data-vector-ref/ type)) @@ -139,8 +175,8 @@ (inst shr ecx ,bit-shift) (inst mov result (make-ea :dword :base object :index ecx :scale 4 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type))) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag))) (move ecx index) (inst and ecx ,(1- elements-per-word)) ,@(unless (= bits 1) @@ -158,7 +194,7 @@ (:generator 15 (multiple-value-bind (word extra) (floor index ,elements-per-word) (loadw result object (+ word vector-data-offset) - other-pointer-type) + other-pointer-lowtag) (unless (zerop extra) (inst shr result (* extra ,bits))) (unless (= extra ,(1- elements-per-word)) @@ -182,8 +218,8 @@ (inst shr word-index ,bit-shift) (inst lea ptr (make-ea :dword :base object :index word-index :scale 4 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type))) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag))) (loadw old ptr) (move ecx index) (inst and ecx ,(1- elements-per-word)) @@ -220,8 +256,9 @@ (multiple-value-bind (word extra) (floor index ,elements-per-word) (inst mov old (make-ea :dword :base object - :disp (- (* (+ word vector-data-offset) word-bytes) - other-pointer-type))) + :disp (- (* (+ word vector-data-offset) + n-word-bytes) + other-pointer-lowtag))) (sc-case value (immediate (let* ((value (tn-value value)) @@ -240,8 +277,8 @@ (inst rol old shift))))) (inst mov (make-ea :dword :base object :disp (- (* (+ word vector-data-offset) - word-bytes) - other-pointer-type)) + n-word-bytes) + other-pointer-lowtag)) old) (sc-case value (immediate @@ -266,8 +303,9 @@ (:generator 5 (with-empty-tn@fp-top(value) (inst fld (make-ea :dword :base object :index index :scale 1 - :disp (- (* sb!vm:vector-data-offset sb!vm:word-bytes) - sb!vm:other-pointer-type)))))) + :disp (- (* sb!vm:vector-data-offset + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag)))))) (define-vop (data-vector-ref-c/simple-array-single-float) (:note "inline array access") @@ -282,9 +320,9 @@ (with-empty-tn@fp-top(value) (inst fld (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 4 index)) - sb!vm:other-pointer-type)))))) + sb!vm:other-pointer-lowtag)))))) (define-vop (data-vector-set/simple-array-single-float) (:note "inline array store") @@ -298,11 +336,11 @@ (:result-types single-float) (:generator 5 (cond ((zerop (tn-offset value)) - ;; Value is in ST0 + ;; Value is in ST0. (inst fst (make-ea :dword :base object :index index :scale 1 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result)) ;; Value is in ST0 but not result. (inst fst result))) @@ -311,8 +349,8 @@ (inst fxch value) (inst fst (make-ea :dword :base object :index index :scale 1 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result)) ;; The result is in ST0. (inst fst value)) @@ -335,12 +373,12 @@ (:result-types single-float) (:generator 4 (cond ((zerop (tn-offset value)) - ;; Value is in ST0 + ;; Value is in ST0. (inst fst (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 4 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result)) ;; Value is in ST0 but not result. (inst fst result))) @@ -349,9 +387,9 @@ (inst fxch value) (inst fst (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 4 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result)) ;; The result is in ST0. (inst fst value)) @@ -373,8 +411,9 @@ (:generator 7 (with-empty-tn@fp-top(value) (inst fldd (make-ea :dword :base object :index index :scale 2 - :disp (- (* sb!vm:vector-data-offset sb!vm:word-bytes) - sb!vm:other-pointer-type)))))) + :disp (- (* sb!vm:vector-data-offset + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag)))))) (define-vop (data-vector-ref-c/simple-array-double-float) (:note "inline array access") @@ -389,9 +428,9 @@ (with-empty-tn@fp-top(value) (inst fldd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index)) - sb!vm:other-pointer-type)))))) + sb!vm:other-pointer-lowtag)))))) (define-vop (data-vector-set/simple-array-double-float) (:note "inline array store") @@ -405,11 +444,11 @@ (:result-types double-float) (:generator 20 (cond ((zerop (tn-offset value)) - ;; Value is in ST0 + ;; Value is in ST0. (inst fstd (make-ea :dword :base object :index index :scale 2 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result)) ;; Value is in ST0 but not result. (inst fstd result))) @@ -418,8 +457,8 @@ (inst fxch value) (inst fstd (make-ea :dword :base object :index index :scale 2 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result)) ;; The result is in ST0. (inst fstd value)) @@ -442,12 +481,12 @@ (:result-types double-float) (:generator 19 (cond ((zerop (tn-offset value)) - ;; Value is in ST0 + ;; Value is in ST0. (inst fstd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result)) ;; Value is in ST0 but not result. (inst fstd result))) @@ -456,9 +495,9 @@ (inst fxch value) (inst fstd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result)) ;; The result is in ST0. (inst fstd value)) @@ -485,8 +524,8 @@ (with-empty-tn@fp-top(value) (inst fldl (make-ea :dword :base object :index temp :scale 1 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type)))))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag)))))) #!+long-float (define-vop (data-vector-ref-c/simple-array-long-float) @@ -502,9 +541,9 @@ (with-empty-tn@fp-top(value) (inst fldl (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 12 index)) - sb!vm:other-pointer-type)))))) + sb!vm:other-pointer-lowtag)))))) #!+long-float (define-vop (data-vector-set/simple-array-long-float) @@ -522,11 +561,11 @@ ;; temp = 3 * index (inst lea temp (make-ea :dword :base index :index index :scale 2)) (cond ((zerop (tn-offset value)) - ;; Value is in ST0 + ;; Value is in ST0. (store-long-float (make-ea :dword :base object :index temp :scale 1 - :disp (- (* sb!vm:vector-data-offset sb!vm:word-bytes) - sb!vm:other-pointer-type))) + :disp (- (* sb!vm:vector-data-offset sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result)) ;; Value is in ST0 but not result. (inst fstd result))) @@ -535,8 +574,8 @@ (inst fxch value) (store-long-float (make-ea :dword :base object :index temp :scale 1 - :disp (- (* sb!vm:vector-data-offset sb!vm:word-bytes) - sb!vm:other-pointer-type))) + :disp (- (* sb!vm:vector-data-offset sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result)) ;; The result is in ST0. (inst fstd value)) @@ -559,12 +598,12 @@ (:result-types long-float) (:generator 19 (cond ((zerop (tn-offset value)) - ;; Value is in ST0 + ;; Value is in ST0. (store-long-float (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 12 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result)) ;; Value is in ST0 but not result. (inst fstd result))) @@ -573,9 +612,9 @@ (inst fxch value) (store-long-float (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 12 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result)) ;; The result is in ST0. (inst fstd value)) @@ -601,14 +640,14 @@ (with-empty-tn@fp-top (real-tn) (inst fld (make-ea :dword :base object :index index :scale 2 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))))) (let ((imag-tn (complex-single-reg-imag-tn value))) (with-empty-tn@fp-top (imag-tn) (inst fld (make-ea :dword :base object :index index :scale 2 :disp (- (* (1+ sb!vm:vector-data-offset) - sb!vm:word-bytes) - sb!vm:other-pointer-type))))))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))))))) (define-vop (data-vector-ref-c/simple-array-complex-single-float) (:note "inline array access") @@ -624,16 +663,16 @@ (with-empty-tn@fp-top (real-tn) (inst fld (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index)) - sb!vm:other-pointer-type))))) + sb!vm:other-pointer-lowtag))))) (let ((imag-tn (complex-single-reg-imag-tn value))) (with-empty-tn@fp-top (imag-tn) (inst fld (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index) 4) - sb!vm:other-pointer-type))))))) + sb!vm:other-pointer-lowtag))))))) (define-vop (data-vector-set/simple-array-complex-single-float) (:note "inline array store") @@ -653,8 +692,8 @@ ;; Value is in ST0. (inst fst (make-ea :dword :base object :index index :scale 2 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result-real)) ;; Value is in ST0 but not result. (inst fst result-real))) @@ -663,8 +702,8 @@ (inst fxch value-real) (inst fst (make-ea :dword :base object :index index :scale 2 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result-real)) ;; The result is in ST0. (inst fst value-real)) @@ -678,9 +717,9 @@ (inst fxch value-imag) (inst fst (make-ea :dword :base object :index index :scale 2 :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) 4) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (location= value-imag result-imag) (inst fst result-imag)) (inst fxch value-imag)))) @@ -700,12 +739,12 @@ (let ((value-real (complex-single-reg-real-tn value)) (result-real (complex-single-reg-real-tn result))) (cond ((zerop (tn-offset value-real)) - ;; Value is in ST0 + ;; Value is in ST0. (inst fst (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result-real)) ;; Value is in ST0 but not result. (inst fst result-real))) @@ -714,9 +753,9 @@ (inst fxch value-real) (inst fst (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result-real)) ;; The result is in ST0. (inst fst value-real)) @@ -730,9 +769,9 @@ (inst fxch value-imag) (inst fst (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 8 index) 4) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (location= value-imag result-imag) (inst fst result-imag)) (inst fxch value-imag)))) @@ -752,15 +791,15 @@ (with-empty-tn@fp-top (real-tn) (inst fldd (make-ea :dword :base object :index index :scale 4 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))))) (let ((imag-tn (complex-double-reg-imag-tn value))) (with-empty-tn@fp-top (imag-tn) (inst fldd (make-ea :dword :base object :index index :scale 4 :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) 8) - sb!vm:other-pointer-type))))))) + sb!vm:other-pointer-lowtag))))))) (define-vop (data-vector-ref-c/simple-array-complex-double-float) (:note "inline array access") @@ -776,16 +815,16 @@ (with-empty-tn@fp-top (real-tn) (inst fldd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 16 index)) - sb!vm:other-pointer-type))))) + sb!vm:other-pointer-lowtag))))) (let ((imag-tn (complex-double-reg-imag-tn value))) (with-empty-tn@fp-top (imag-tn) (inst fldd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 16 index) 8) - sb!vm:other-pointer-type))))))) + sb!vm:other-pointer-lowtag))))))) (define-vop (data-vector-set/simple-array-complex-double-float) (:note "inline array store") @@ -802,11 +841,11 @@ (let ((value-real (complex-double-reg-real-tn value)) (result-real (complex-double-reg-real-tn result))) (cond ((zerop (tn-offset value-real)) - ;; Value is in ST0 + ;; Value is in ST0. (inst fstd (make-ea :dword :base object :index index :scale 4 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result-real)) ;; Value is in ST0 but not result. (inst fstd result-real))) @@ -815,8 +854,8 @@ (inst fxch value-real) (inst fstd (make-ea :dword :base object :index index :scale 4 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result-real)) ;; The result is in ST0. (inst fstd value-real)) @@ -830,9 +869,9 @@ (inst fxch value-imag) (inst fstd (make-ea :dword :base object :index index :scale 4 :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) 8) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (location= value-imag result-imag) (inst fstd result-imag)) (inst fxch value-imag)))) @@ -852,12 +891,12 @@ (let ((value-real (complex-double-reg-real-tn value)) (result-real (complex-double-reg-real-tn result))) (cond ((zerop (tn-offset value-real)) - ;; Value is in ST0 + ;; Value is in ST0. (inst fstd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 16 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result-real)) ;; Value is in ST0 but not result. (inst fstd result-real))) @@ -866,9 +905,9 @@ (inst fxch value-real) (inst fstd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 16 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result-real)) ;; The result is in ST0. (inst fstd value-real)) @@ -882,9 +921,9 @@ (inst fxch value-imag) (inst fstd (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 16 index) 8) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (location= value-imag result-imag) (inst fstd result-imag)) (inst fxch value-imag)))) @@ -908,15 +947,15 @@ (with-empty-tn@fp-top (real-tn) (inst fldl (make-ea :dword :base object :index temp :scale 2 :disp (- (* sb!vm:vector-data-offset - sb!vm:word-bytes) - sb!vm:other-pointer-type))))) + sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))))) (let ((imag-tn (complex-long-reg-imag-tn value))) (with-empty-tn@fp-top (imag-tn) (inst fldl (make-ea :dword :base object :index temp :scale 2 :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) 12) - sb!vm:other-pointer-type))))))) + sb!vm:other-pointer-lowtag))))))) #!+long-float (define-vop (data-vector-ref-c/simple-array-complex-long-float) @@ -933,16 +972,16 @@ (with-empty-tn@fp-top (real-tn) (inst fldl (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 24 index)) - sb!vm:other-pointer-type))))) + sb!vm:other-pointer-lowtag))))) (let ((imag-tn (complex-long-reg-imag-tn value))) (with-empty-tn@fp-top (imag-tn) (inst fldl (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 24 index) 12) - sb!vm:other-pointer-type))))))) + sb!vm:other-pointer-lowtag))))))) #!+long-float (define-vop (data-vector-set/simple-array-complex-long-float) @@ -963,11 +1002,11 @@ (let ((value-real (complex-long-reg-real-tn value)) (result-real (complex-long-reg-real-tn result))) (cond ((zerop (tn-offset value-real)) - ;; Value is in ST0 + ;; Value is in ST0. (store-long-float (make-ea :dword :base object :index temp :scale 2 - :disp (- (* sb!vm:vector-data-offset sb!vm:word-bytes) - sb!vm:other-pointer-type))) + :disp (- (* sb!vm:vector-data-offset sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result-real)) ;; Value is in ST0 but not result. (inst fstd result-real))) @@ -976,8 +1015,8 @@ (inst fxch value-real) (store-long-float (make-ea :dword :base object :index temp :scale 2 - :disp (- (* sb!vm:vector-data-offset sb!vm:word-bytes) - sb!vm:other-pointer-type))) + :disp (- (* sb!vm:vector-data-offset sb!vm:n-word-bytes) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result-real)) ;; The result is in ST0. (inst fstd value-real)) @@ -991,8 +1030,8 @@ (inst fxch value-imag) (store-long-float (make-ea :dword :base object :index temp :scale 2 - :disp (- (+ (* sb!vm:vector-data-offset sb!vm:word-bytes) 12) - sb!vm:other-pointer-type))) + :disp (- (+ (* sb!vm:vector-data-offset sb!vm:n-word-bytes) 12) + sb!vm:other-pointer-lowtag))) (unless (location= value-imag result-imag) (inst fstd result-imag)) (inst fxch value-imag)))) @@ -1013,13 +1052,13 @@ (let ((value-real (complex-long-reg-real-tn value)) (result-real (complex-long-reg-real-tn result))) (cond ((zerop (tn-offset value-real)) - ;; Value is in ST0 + ;; Value is in ST0. (store-long-float (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 24 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (zerop (tn-offset result-real)) ;; Value is in ST0 but not result. (inst fstd result-real))) @@ -1029,9 +1068,9 @@ (store-long-float (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) (* 24 index)) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (cond ((zerop (tn-offset result-real)) ;; The result is in ST0. (inst fstd value-real)) @@ -1046,21 +1085,18 @@ (store-long-float (make-ea :dword :base object :disp (- (+ (* sb!vm:vector-data-offset - sb!vm:word-bytes) + sb!vm:n-word-bytes) ;; FIXME: There are so many of these bare constants ;; (24, 12..) in the LONG-FLOAT code that it's ;; ridiculous. I should probably just delete it all ;; instead of appearing to flirt with supporting ;; this maintenance nightmare. (* 24 index) 12) - sb!vm:other-pointer-type))) + sb!vm:other-pointer-lowtag))) (unless (location= value-imag result-imag) (inst fstd result-imag)) (inst fxch value-imag)))) - -;;;; dtc expanded and fixed the following: - ;;; unsigned-byte-8 (define-vop (data-vector-ref/simple-array-unsigned-byte-8) @@ -1074,8 +1110,8 @@ (:generator 5 (inst movzx value (make-ea :byte :base object :index index :scale 1 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type))))) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag))))) (define-vop (data-vector-ref-c/simple-array-unsigned-byte-8) (:translate data-vector-ref) @@ -1088,8 +1124,8 @@ (:generator 4 (inst movzx value (make-ea :byte :base object - :disp (- (+ (* vector-data-offset word-bytes) index) - other-pointer-type))))) + :disp (- (+ (* vector-data-offset n-word-bytes) index) + other-pointer-lowtag))))) (define-vop (data-vector-set/simple-array-unsigned-byte-8) (:translate data-vector-set) @@ -1106,8 +1142,8 @@ (:generator 5 (move eax value) (inst mov (make-ea :byte :base object :index index :scale 1 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type)) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag)) al-tn) (move result eax))) @@ -1127,8 +1163,8 @@ (:generator 4 (move eax value) (inst mov (make-ea :byte :base object - :disp (- (+ (* vector-data-offset word-bytes) index) - other-pointer-type)) + :disp (- (+ (* vector-data-offset n-word-bytes) index) + other-pointer-lowtag)) al-tn) (move result eax))) @@ -1145,8 +1181,8 @@ (:generator 5 (inst movzx value (make-ea :word :base object :index index :scale 2 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type))))) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag))))) (define-vop (data-vector-ref-c/simple-array-unsigned-byte-16) (:translate data-vector-ref) @@ -1159,8 +1195,8 @@ (:generator 4 (inst movzx value (make-ea :word :base object - :disp (- (+ (* vector-data-offset word-bytes) (* 2 index)) - other-pointer-type))))) + :disp (- (+ (* vector-data-offset n-word-bytes) (* 2 index)) + other-pointer-lowtag))))) (define-vop (data-vector-set/simple-array-unsigned-byte-16) (:translate data-vector-set) @@ -1177,8 +1213,8 @@ (:generator 5 (move eax value) (inst mov (make-ea :word :base object :index index :scale 2 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type)) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag)) ax-tn) (move result eax))) @@ -1198,9 +1234,9 @@ (:generator 4 (move eax value) (inst mov (make-ea :word :base object - :disp (- (+ (* vector-data-offset word-bytes) + :disp (- (+ (* vector-data-offset n-word-bytes) (* 2 index)) - other-pointer-type)) + other-pointer-lowtag)) ax-tn) (move result eax))) @@ -1223,8 +1259,8 @@ (:generator 5 (inst mov al-tn (make-ea :byte :base object :index index :scale 1 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type))) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag))) (move value al-tn))) (define-vop (data-vector-ref-c/simple-string) @@ -1242,8 +1278,8 @@ (:generator 4 (inst mov al-tn (make-ea :byte :base object - :disp (- (+ (* vector-data-offset word-bytes) index) - other-pointer-type))) + :disp (- (+ (* vector-data-offset n-word-bytes) index) + other-pointer-lowtag))) (move value al-tn))) (define-vop (data-vector-set/simple-string) @@ -1257,8 +1293,8 @@ (:result-types base-char) (:generator 5 (inst mov (make-ea :byte :base object :index index :scale 1 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type)) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag)) value) (move result value))) @@ -1273,8 +1309,8 @@ (:result-types base-char) (:generator 4 (inst mov (make-ea :byte :base object - :disp (- (+ (* vector-data-offset word-bytes) index) - other-pointer-type)) + :disp (- (+ (* vector-data-offset n-word-bytes) index) + other-pointer-lowtag)) value) (move result value))) @@ -1291,8 +1327,8 @@ (:generator 5 (inst movsx value (make-ea :byte :base object :index index :scale 1 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type))))) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag))))) (define-vop (data-vector-ref-c/simple-array-signed-byte-8) (:translate data-vector-ref) @@ -1305,8 +1341,8 @@ (:generator 4 (inst movsx value (make-ea :byte :base object - :disp (- (+ (* vector-data-offset word-bytes) index) - other-pointer-type))))) + :disp (- (+ (* vector-data-offset n-word-bytes) index) + other-pointer-lowtag))))) (define-vop (data-vector-set/simple-array-signed-byte-8) (:translate data-vector-set) @@ -1323,8 +1359,8 @@ (:generator 5 (move eax value) (inst mov (make-ea :byte :base object :index index :scale 1 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type)) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag)) al-tn) (move result eax))) @@ -1344,8 +1380,8 @@ (:generator 4 (move eax value) (inst mov (make-ea :byte :base object - :disp (- (+ (* vector-data-offset word-bytes) index) - other-pointer-type)) + :disp (- (+ (* vector-data-offset n-word-bytes) index) + other-pointer-lowtag)) al-tn) (move result eax))) @@ -1362,8 +1398,8 @@ (:generator 5 (inst movsx value (make-ea :word :base object :index index :scale 2 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type))))) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag))))) (define-vop (data-vector-ref-c/simple-array-signed-byte-16) (:translate data-vector-ref) @@ -1376,9 +1412,9 @@ (:generator 4 (inst movsx value (make-ea :word :base object - :disp (- (+ (* vector-data-offset word-bytes) + :disp (- (+ (* vector-data-offset n-word-bytes) (* 2 index)) - other-pointer-type))))) + other-pointer-lowtag))))) (define-vop (data-vector-set/simple-array-signed-byte-16) (:translate data-vector-set) @@ -1395,8 +1431,8 @@ (:generator 5 (move eax value) (inst mov (make-ea :word :base object :index index :scale 2 - :disp (- (* vector-data-offset word-bytes) - other-pointer-type)) + :disp (- (* vector-data-offset n-word-bytes) + other-pointer-lowtag)) ax-tn) (move result eax))) @@ -1416,9 +1452,9 @@ (move eax value) (inst mov (make-ea :word :base object - :disp (- (+ (* vector-data-offset word-bytes) + :disp (- (+ (* vector-data-offset n-word-bytes) (* 2 index)) - other-pointer-type)) + other-pointer-lowtag)) ax-tn) (move result eax))) @@ -1530,9 +1566,9 @@ ;;; These vops are useful for accessing the bits of a vector ;;; irrespective of what type of vector it is. -(define-full-reffer raw-bits * 0 other-pointer-type (unsigned-reg) +(define-full-reffer raw-bits * 0 other-pointer-lowtag (unsigned-reg) unsigned-num %raw-bits) -(define-full-setter set-raw-bits * 0 other-pointer-type (unsigned-reg) +(define-full-setter set-raw-bits * 0 other-pointer-lowtag (unsigned-reg) unsigned-num %set-raw-bits) ;;;; miscellaneous array VOPs