-(define-vop (data-vector-set-c/simple-array-complex-double-float)
- (:note "inline array store")
- (:translate data-vector-set)
- (:policy :fast-safe)
- (:args (object :scs (descriptor-reg))
- (value :scs (complex-double-reg) :target result))
- (:info index)
- (:arg-types simple-array-complex-double-float (:constant (signed-byte 30))
- complex-double-float)
- (:results (result :scs (complex-double-reg)))
- (:result-types complex-double-float)
- (:generator 19
- (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.
- (inst fstd (make-ea :dword :base object
- :disp (- (+ (* sb!vm:vector-data-offset
- sb!vm:n-word-bytes)
- (* 16 index))
- sb!vm:other-pointer-lowtag)))
- (unless (zerop (tn-offset result-real))
- ;; Value is in ST0 but not result.
- (inst fstd result-real)))
- (t
- ;; Value is not in ST0.
- (inst fxch value-real)
- (inst fstd (make-ea :dword :base object
- :disp (- (+ (* sb!vm:vector-data-offset
- sb!vm:n-word-bytes)
- (* 16 index))
- sb!vm:other-pointer-lowtag)))
- (cond ((zerop (tn-offset result-real))
- ;; The result is in ST0.
- (inst fstd value-real))
- (t
- ;; Neither value or result are in ST0
- (unless (location= value-real result-real)
- (inst fstd result-real))
- (inst fxch value-real))))))
- (let ((value-imag (complex-double-reg-imag-tn value))
- (result-imag (complex-double-reg-imag-tn result)))
- (inst fxch value-imag)
- (inst fstd (make-ea :dword :base object
- :disp (- (+ (* sb!vm:vector-data-offset
- sb!vm:n-word-bytes)
- (* 16 index) 8)
- sb!vm:other-pointer-lowtag)))
- (unless (location= value-imag result-imag)
- (inst fstd result-imag))
- (inst fxch value-imag))))
-
-
-#!+long-float
-(define-vop (data-vector-ref/simple-array-complex-long-float)
- (:note "inline array access")
- (:translate data-vector-ref)
- (:policy :fast-safe)
- (:args (object :scs (descriptor-reg) :to :result)
- (index :scs (any-reg)))
- (:arg-types simple-array-complex-long-float positive-fixnum)
- (:temporary (:sc any-reg :from :eval :to :result) temp)
- (:results (value :scs (complex-long-reg)))
- (:result-types complex-long-float)
- (:generator 7
- ;; temp = 3 * index
- (inst lea temp (make-ea :dword :base index :index index :scale 2))
- (let ((real-tn (complex-long-reg-real-tn value)))
- (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: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:n-word-bytes)
- 12)
- sb!vm:other-pointer-lowtag)))))))
-
-#!+long-float
-(define-vop (data-vector-ref-c/simple-array-complex-long-float)
- (:note "inline array access")
- (:translate data-vector-ref)
- (:policy :fast-safe)
- (:args (object :scs (descriptor-reg)))
- (:info index)
- (:arg-types simple-array-complex-long-float (:constant (signed-byte 30)))
- (:results (value :scs (complex-long-reg)))
- (:result-types complex-long-float)
- (:generator 6
- (let ((real-tn (complex-long-reg-real-tn value)))
- (with-empty-tn@fp-top (real-tn)
- (inst fldl (make-ea :dword :base object
- :disp (- (+ (* sb!vm:vector-data-offset
- sb!vm:n-word-bytes)
- (* 24 index))
- 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:n-word-bytes)
- (* 24 index) 12)
- sb!vm:other-pointer-lowtag)))))))
-
-#!+long-float
-(define-vop (data-vector-set/simple-array-complex-long-float)
- (:note "inline array store")
- (:translate data-vector-set)
- (:policy :fast-safe)
- (:args (object :scs (descriptor-reg) :to :result)
- (index :scs (any-reg))
- (value :scs (complex-long-reg) :target result))
- (:arg-types simple-array-complex-long-float positive-fixnum
- complex-long-float)
- (:temporary (:sc any-reg :from (:argument 1) :to :result) temp)
- (:results (result :scs (complex-long-reg)))
- (:result-types complex-long-float)
- (:generator 20
- ;; temp = 3 * index
- (inst lea temp (make-ea :dword :base index :index index :scale 2))
- (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.
- (store-long-float
- (make-ea :dword :base object :index temp :scale 2
- :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)))
- (t
- ;; Value is not in ST0.
- (inst fxch value-real)
- (store-long-float
- (make-ea :dword :base object :index temp :scale 2
- :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))
- (t
- ;; Neither value or result are in ST0
- (unless (location= value-real result-real)
- (inst fstd result-real))
- (inst fxch value-real))))))
- (let ((value-imag (complex-long-reg-imag-tn value))
- (result-imag (complex-long-reg-imag-tn result)))
- (inst fxch value-imag)
- (store-long-float
- (make-ea :dword :base object :index temp :scale 2
- :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))))
-
-#!+long-float
-(define-vop (data-vector-set-c/simple-array-complex-long-float)
- (:note "inline array store")
- (:translate data-vector-set)
- (:policy :fast-safe)
- (:args (object :scs (descriptor-reg))
- (value :scs (complex-long-reg) :target result))
- (:info index)
- (:arg-types simple-array-complex-long-float (:constant (signed-byte 30))
- complex-long-float)
- (:results (result :scs (complex-long-reg)))
- (:result-types complex-long-float)
- (:generator 19
- (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.
- (store-long-float
- (make-ea :dword :base object
- :disp (- (+ (* sb!vm:vector-data-offset
- sb!vm:n-word-bytes)
- (* 24 index))
- sb!vm:other-pointer-lowtag)))
- (unless (zerop (tn-offset result-real))
- ;; Value is in ST0 but not result.
- (inst fstd result-real)))
- (t
- ;; Value is not in ST0.
- (inst fxch value-real)
- (store-long-float
- (make-ea :dword :base object
- :disp (- (+ (* sb!vm:vector-data-offset
- sb!vm:n-word-bytes)
- (* 24 index))
- sb!vm:other-pointer-lowtag)))
- (cond ((zerop (tn-offset result-real))
- ;; The result is in ST0.
- (inst fstd value-real))
- (t
- ;; Neither value or result are in ST0
- (unless (location= value-real result-real)
- (inst fstd result-real))
- (inst fxch value-real))))))
- (let ((value-imag (complex-long-reg-imag-tn value))
- (result-imag (complex-long-reg-imag-tn result)))
- (inst fxch value-imag)
- (store-long-float
- (make-ea :dword :base object
- :disp (- (+ (* sb!vm:vector-data-offset
- 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-lowtag)))
- (unless (location= value-imag result-imag)
- (inst fstd result-imag))
- (inst fxch value-imag))))