Name effective-address constructors symmetrically

We already had instance-slot-ea, thread-slot-ea, and
static-symbol-value-ea, so rename these to match:
  make-ea-for-object-slot -> object-slot-ea
  make-ea-for-float-ref -> float-ref-ea
This commit is contained in:
Douglas Katzman 2019-11-10 11:54:16 -05:00
parent bf5f0c8d80
commit e79e7f6799
24 changed files with 87 additions and 96 deletions

View file

@ -290,7 +290,7 @@
(inst test catch catch) ; check for NULL pointer
(inst jmp :z error))
(inst cmp target (make-ea-for-object-slot catch catch-block-tag-slot 0))
(inst cmp target (object-slot-ea catch catch-block-tag-slot 0))
(inst jmp :e EXIT)
(loadw catch catch catch-block-previous-catch-slot)
@ -329,7 +329,7 @@
;; Does *CURRENT-UNWIND-PROTECT-BLOCK* match the value stored in
;; argument's CURRENT-UWP-SLOT?
(inst cmp uwp
(make-ea-for-object-slot block unwind-block-uwp-slot 0))
(object-slot-ea block unwind-block-uwp-slot 0))
;; If a match, return to conitext in arg block.
(inst jmp :e DO-EXIT)

View file

@ -144,10 +144,10 @@
(closure-tramp (:return-style :none))
()
(loadw rax-tn rax-tn fdefn-fun-slot other-pointer-lowtag)
(inst jmp (make-ea-for-object-slot rax-tn closure-fun-slot fun-pointer-lowtag)))
(inst jmp (object-slot-ea rax-tn closure-fun-slot fun-pointer-lowtag)))
(define-assembly-routine
(funcallable-instance-tramp (:return-style :none))
()
(loadw rax-tn rax-tn funcallable-instance-function-slot fun-pointer-lowtag)
(inst jmp (make-ea-for-object-slot rax-tn closure-fun-slot fun-pointer-lowtag)))
(inst jmp (object-slot-ea rax-tn closure-fun-slot fun-pointer-lowtag)))

View file

@ -195,7 +195,7 @@
(inst push ebx)
;; And jump into the function.
(inst jmp (make-ea-for-object-slot eax closure-fun-slot fun-pointer-lowtag))
(inst jmp (object-slot-ea eax closure-fun-slot fun-pointer-lowtag))
;; All the arguments fit in registers, so load them.
REGISTER-ARGS
@ -211,7 +211,7 @@
(pushw ebp-tn (frame-word-offset return-pc-save-offset))
;; And away we go.
(inst jmp (make-ea-for-object-slot eax closure-fun-slot fun-pointer-lowtag)))
(inst jmp (object-slot-ea eax closure-fun-slot fun-pointer-lowtag)))
(define-assembly-routine (throw
(:return-style :raw))
@ -240,7 +240,7 @@
(inst test catch catch) ; check for NULL pointer
(inst jmp :z error))
(inst cmp target (make-ea-for-object-slot catch catch-block-tag-slot 0))
(inst cmp target (object-slot-ea catch catch-block-tag-slot 0))
(inst jmp :e EXIT)
(loadw catch catch catch-block-previous-catch-slot)
@ -275,7 +275,7 @@
;; Does *CURRENT-UNWIND-PROTECT-BLOCK* match the value stored in
;; argument's CURRENT-UWP-SLOT?
(inst cmp uwp
(make-ea-for-object-slot block unwind-block-uwp-slot 0))
(object-slot-ea block unwind-block-uwp-slot 0))
;; If a match, return to context in arg block.
(inst jmp :e DO-EXIT)
@ -297,7 +297,7 @@
;; be saved on the stack: the block in edx-tn, start in ebx-tn, and
;; count in ecx-tn.
(inst jmp (make-ea-for-object-slot block unwind-block-entry-pc-slot 0)))
(inst jmp (object-slot-ea block unwind-block-entry-pc-slot 0)))
;;;; Win32 non-local exit noise
@ -355,7 +355,7 @@
;; Nlx-entry expects the arg start in ebx-tn and the arg count
;; in ecx-tn. Fortunately, that's where they are already.
(inst jmp (make-ea-for-object-slot block unwind-block-entry-pc-slot 0)))
(inst jmp (object-slot-ea block unwind-block-entry-pc-slot 0)))
;;;; Win32 UWP block SEH interface.
@ -438,7 +438,7 @@
(inst xor ecx-tn ecx-tn)
(inst mov ebx-tn ebp-tn)
(loadw ebp-tn block unwind-block-cfp-slot)
(inst jmp (make-ea-for-object-slot block unwind-block-entry-pc-slot 0)))
(inst jmp (object-slot-ea block unwind-block-entry-pc-slot 0)))
#+win32
(define-assembly-routine (continue-unwind

View file

@ -19,10 +19,10 @@
(closure-tramp (:return-style :none))
()
(loadw eax-tn eax-tn fdefn-fun-slot other-pointer-lowtag)
(inst jmp (make-ea-for-object-slot eax-tn closure-fun-slot fun-pointer-lowtag)))
(inst jmp (object-slot-ea eax-tn closure-fun-slot fun-pointer-lowtag)))
(define-assembly-routine
(funcallable-instance-tramp (:return-style :none))
()
(loadw eax-tn eax-tn funcallable-instance-function-slot fun-pointer-lowtag)
(inst jmp (make-ea-for-object-slot eax-tn closure-fun-slot fun-pointer-lowtag)))
(inst jmp (object-slot-ea eax-tn closure-fun-slot fun-pointer-lowtag)))

View file

@ -2113,9 +2113,7 @@ constant shift greater than word length")))
(inst and r (constantize mask))))
(t
(inst mov r mask)
(inst and r (make-ea-for-object-slot x
bignum-digits-offset
other-pointer-lowtag))))))
(inst and r (object-slot-ea x bignum-digits-offset other-pointer-lowtag))))))
;; Specialised mask-signed-field VOPs.
(flet ((shift-unshift (reg width)

View file

@ -436,7 +436,7 @@
(def-small-data-vector-frobs simple-array-unsigned-byte-4 4))
;;; And the float variants.
(defun make-ea-for-float-ref (object index offset element-size
(defun float-ref-ea (object index offset element-size
&key (scale 1) (complex-offset 0))
(etypecase index
(integer
@ -471,8 +471,8 @@
,@(if use-temp
'((move dword-index index)
(inst shr dword-index (1+ (- n-fixnum-tag-bits word-shift)))
(inst movss value (make-ea-for-float-ref object dword-index offset 4)))
'((inst movss value (make-ea-for-float-ref object index offset 4
(inst movss value (float-ref-ea object dword-index offset 4)))
'((inst movss value (float-ref-ea object index offset 4
:scale (ash 4 (- n-fixnum-tag-bits)))))))))
(define-vop (data-vector-ref-with-offset/simple-array-single-float-c)
@ -487,7 +487,7 @@
(:results (value :scs (single-reg)))
(:result-types single-float)
(:generator 4
(inst movss value (make-ea-for-float-ref object index offset 4))))
(inst movss value (float-ref-ea object index offset 4))))
#.
(let ((use-temp (<= word-shift n-fixnum-tag-bits)))
@ -510,8 +510,8 @@
,@(if use-temp
'((move dword-index index)
(inst shr dword-index (1+ (- n-fixnum-tag-bits word-shift)))
(inst movss (make-ea-for-float-ref object dword-index offset 4) value))
'((inst movss (make-ea-for-float-ref object index offset 4
(inst movss (float-ref-ea object dword-index offset 4) value))
'((inst movss (float-ref-ea object index offset 4
:scale (ash 4 (- n-fixnum-tag-bits))) value)))
(move result value))))
@ -529,7 +529,7 @@
(:results (result :scs (single-reg)))
(:result-types single-float)
(:generator 4
(inst movss (make-ea-for-float-ref object index offset 4) value)
(inst movss (float-ref-ea object index offset 4) value)
(move result value)))
(define-vop (data-vector-ref-with-offset/simple-array-double-float)
@ -545,7 +545,7 @@
(:results (value :scs (double-reg)))
(:result-types double-float)
(:generator 7
(inst movsd value (make-ea-for-float-ref object index offset 8
(inst movsd value (float-ref-ea object index offset 8
:scale (ash 1 (- word-shift n-fixnum-tag-bits))))))
(define-vop (data-vector-ref-c/simple-array-double-float)
@ -560,7 +560,7 @@
(:results (value :scs (double-reg)))
(:result-types double-float)
(:generator 6
(inst movsd value (make-ea-for-float-ref object index offset 8))))
(inst movsd value (float-ref-ea object index offset 8))))
(define-vop (data-vector-set-with-offset/simple-array-double-float)
(:note "inline array store")
@ -577,7 +577,7 @@
(:results (result :scs (double-reg)))
(:result-types double-float)
(:generator 20
(inst movsd (make-ea-for-float-ref object index offset 8
(inst movsd (float-ref-ea object index offset 8
:scale (ash 1 (- word-shift n-fixnum-tag-bits)))
value)
(move result value)))
@ -596,7 +596,7 @@
(:results (result :scs (double-reg)))
(:result-types double-float)
(:generator 19
(inst movsd (make-ea-for-float-ref object index offset 8) value)
(inst movsd (float-ref-ea object index offset 8) value)
(move result value)))
@ -615,7 +615,7 @@
(:results (value :scs (complex-single-reg)))
(:result-types complex-single-float)
(:generator 5
(inst movq value (make-ea-for-float-ref object index offset 8
(inst movq value (float-ref-ea object index offset 8
:scale (ash 1 (- word-shift n-fixnum-tag-bits))))))
(define-vop (data-vector-ref-with-offset/simple-array-complex-single-float-c)
@ -630,7 +630,7 @@
(:results (value :scs (complex-single-reg)))
(:result-types complex-single-float)
(:generator 4
(inst movq value (make-ea-for-float-ref object index offset 8))))
(inst movq value (float-ref-ea object index offset 8))))
(define-vop (data-vector-set-with-offset/simple-array-complex-single-float)
(:note "inline array store")
@ -648,7 +648,7 @@
(:result-types complex-single-float)
(:generator 5
(move result value)
(inst movq (make-ea-for-float-ref object index offset 8
(inst movq (float-ref-ea object index offset 8
:scale (ash 1 (- word-shift n-fixnum-tag-bits)))
value)))
@ -667,7 +667,7 @@
(:result-types complex-single-float)
(:generator 4
(move result value)
(inst movq (make-ea-for-float-ref object index offset 8) value)))
(inst movq (float-ref-ea object index offset 8) value)))
(define-vop (data-vector-ref-with-offset/simple-array-complex-double-float)
(:note "inline array access")
@ -682,7 +682,7 @@
(:results (value :scs (complex-double-reg)))
(:result-types complex-double-float)
(:generator 7
(inst movapd value (make-ea-for-float-ref object index offset 16
(inst movapd value (float-ref-ea object index offset 16
:scale (ash 2 (- word-shift n-fixnum-tag-bits))))))
(define-vop (data-vector-ref-with-offset/simple-array-complex-double-float-c)
@ -697,7 +697,7 @@
(:results (value :scs (complex-double-reg)))
(:result-types complex-double-float)
(:generator 6
(inst movapd value (make-ea-for-float-ref object index offset 16))))
(inst movapd value (float-ref-ea object index offset 16))))
(define-vop (data-vector-set-with-offset/simple-array-complex-double-float)
(:note "inline array store")
@ -714,7 +714,7 @@
(:results (result :scs (complex-double-reg)))
(:result-types complex-double-float)
(:generator 20
(inst movapd (make-ea-for-float-ref object index offset 16
(inst movapd (float-ref-ea object index offset 16
:scale (ash 2 (- word-shift n-fixnum-tag-bits)))
value)
(move result value)))
@ -733,7 +733,7 @@
(:results (result :scs (complex-double-reg)))
(:result-types complex-double-float)
(:generator 19
(inst movapd (make-ea-for-float-ref object index offset 16) value)
(inst movapd (float-ref-ea object index offset 16) value)
(move result value)))

View file

@ -338,7 +338,7 @@
#+win32 (inst add rsp-tn #x20) ;MS_ABI: remove shadow space
#+sb-safepoint
;; Zero the saved CSP
(inst xor (make-ea-for-object-slot thread-base-tn thread-saved-csp-offset 0)
(inst xor (object-slot-ea thread-base-tn thread-saved-csp-offset 0)
rsp-tn))
(define-vop (alloc-number-stack-space)

View file

@ -54,11 +54,9 @@
(inst push object)))
(invoke-asm-routine 'call 'code-header-set vop))
((equal name '(setf %funcallable-instance-fun))
(gen-cell-set (make-ea-for-object-slot object offset lowtag)
value nil vop t))
(gen-cell-set (object-slot-ea object offset lowtag) value nil vop t))
(t
(gen-cell-set (make-ea-for-object-slot object offset lowtag)
value nil)))))
(gen-cell-set (object-slot-ea object offset lowtag) value nil)))))
;; INIT-SLOT has to know about the :COMPACT-INSTANCE-HEADER feature.
(define-vop (init-slot set-slot)
@ -105,7 +103,7 @@
(gen-cell-set (cond ((sc-is object immediate)
(symbol-slot-ea (tn-value object) symbol-value-slot))
(t
(make-ea-for-object-slot object symbol-value-slot
(object-slot-ea object symbol-value-slot
other-pointer-lowtag)))
value nil)))
@ -349,7 +347,7 @@
(:args (symbol :scs (descriptor-reg)))
(:conditional :ne)
(:generator 9
(inst cmp :dword (make-ea-for-object-slot
(inst cmp :dword (object-slot-ea
symbol symbol-value-slot other-pointer-lowtag)
unbound-marker-widetag))))

View file

@ -1385,7 +1385,7 @@
(ea (frame-byte-offset (tn-offset float)) rbp-tn)))
(descriptor-reg
(inst mov :dword lo-bits
(make-ea-for-object-slot float double-float-value-slot
(object-slot-ea float double-float-value-slot
other-pointer-lowtag))))))

View file

@ -63,13 +63,13 @@
(t
(inst mov dst src)))))
(defmacro make-ea-for-object-slot (ptr slot lowtag)
(defmacro object-slot-ea (ptr slot lowtag)
`(ea (- (* ,slot n-word-bytes) ,lowtag) ,ptr))
(defmacro tls-index-of (sym)
`(ea (+ 4 (- other-pointer-lowtag)) ,sym))
(defmacro loadw (value ptr &optional (slot 0) (lowtag 0))
`(inst mov ,value (make-ea-for-object-slot ,ptr ,slot ,lowtag)))
`(inst mov ,value (object-slot-ea ,ptr ,slot ,lowtag)))
(defun storew (value ptr &optional (slot 0) (lowtag 0))
(let* ((size (if (tn-p value)
@ -85,10 +85,10 @@
(inst mov :qword ea value)))))
(defmacro pushw (ptr &optional (slot 0) (lowtag 0))
`(inst push (make-ea-for-object-slot ,ptr ,slot ,lowtag)))
`(inst push (object-slot-ea ,ptr ,slot ,lowtag)))
(defmacro popw (ptr &optional (slot 0) (lowtag 0))
`(inst pop (make-ea-for-object-slot ,ptr ,slot ,lowtag)))
`(inst pop (object-slot-ea ,ptr ,slot ,lowtag)))
;;;; macros to generate useful values

View file

@ -79,8 +79,7 @@
(:variant-vars offset lowtag)
(:policy :fast-safe)
(:generator 4
(gen-cell-set (make-ea-for-object-slot object offset lowtag)
value nil)))
(gen-cell-set (object-slot-ea object offset lowtag) value nil)))
;;; X86 special
(define-vop (cell-xadd)
@ -92,7 +91,7 @@
(:policy :fast-safe)
(:generator 4
(move result value)
(inst xadd (make-ea-for-object-slot object offset lowtag) result :lock)))
(inst xadd (object-slot-ea object offset lowtag) result :lock)))
(define-vop (cell-xsub cell-xadd)
(:args (object)
@ -108,7 +107,7 @@
(t
(move result value)
(inst neg result)))
(inst xadd (make-ea-for-object-slot object offset lowtag) result :lock)))
(inst xadd (object-slot-ea object offset lowtag) result :lock)))
(define-vop (atomic-inc-symbol-global-value cell-xadd)
(:translate %atomic-inc-symbol-global-value)
@ -169,7 +168,7 @@
(inst sub newval delta))
`(inst lea newval (ea rax delta))))
(inst cmpxchg
(make-ea-for-object-slot cell ,slot list-pointer-lowtag)
(object-slot-ea cell ,slot list-pointer-lowtag)
newval :lock)
(inst jmp :ne retry)
(inst mov result rax)))))))

View file

@ -98,7 +98,7 @@
(int-avx2-reg 0)
(t 0)))
y simd-pack-256-tag-slot other-pointer-lowtag)
(let ((ea (make-ea-for-object-slot
(let ((ea (object-slot-ea
y simd-pack-256-p0-slot other-pointer-lowtag)))
(if (float-avx2-p x)
(inst vmovups ea x)
@ -111,7 +111,7 @@
(:results (y :scs (int-avx2-reg double-avx2-reg single-avx2-reg)))
(:note "pointer to AVX2 coercion")
(:generator 2
(let ((ea (make-ea-for-object-slot x simd-pack-256-p0-slot other-pointer-lowtag)))
(let ((ea (object-slot-ea x simd-pack-256-p0-slot other-pointer-lowtag)))
(if (float-avx2-p y)
(inst vmovups y ea)
(inst vmovdqu y ea)))))

View file

@ -95,8 +95,7 @@
(int-sse-reg 0)
(t 0)))
y simd-pack-tag-slot other-pointer-lowtag)
(let ((ea (make-ea-for-object-slot
y simd-pack-lo-value-slot other-pointer-lowtag)))
(let ((ea (object-slot-ea y simd-pack-lo-value-slot other-pointer-lowtag)))
(if (float-sse-p x)
(inst movaps ea x)
(inst movdqa ea x)))))
@ -108,8 +107,7 @@
(:results (y :scs (int-sse-reg double-sse-reg single-sse-reg)))
(:note "pointer to SSE coercion")
(:generator 2
(let ((ea (make-ea-for-object-slot
x simd-pack-lo-value-slot other-pointer-lowtag)))
(let ((ea (object-slot-ea x simd-pack-lo-value-slot other-pointer-lowtag)))
(if (float-sse-p y)
(inst movaps y ea)
(inst movdqa y ea)))))

View file

@ -330,7 +330,7 @@
(inst lea :dword temp (ea (- list-pointer-lowtag) result))
(inst test :byte temp lowtag-mask)
(inst cmov :e result
(make-ea-for-object-slot result cons-cdr-slot list-pointer-lowtag)))
(object-slot-ea result cons-cdr-slot list-pointer-lowtag)))
(define-vop (symbol-info-vector)
(:policy :fast-safe)

View file

@ -294,8 +294,7 @@
(inst sub temp (+ (ash 2 n-widetag-bits) bignum-widetag))
(inst jmp :ne nope)
;; Compare the second digit to zero (in TEMP).
(inst cmp (make-ea-for-object-slot value (1+ bignum-digits-offset)
other-pointer-lowtag)
(inst cmp (object-slot-ea value (1+ bignum-digits-offset) other-pointer-lowtag)
temp)
(inst jmp :z yep) ; All zeros, its an (unsigned-byte 64).
(inst jmp nope)

View file

@ -342,7 +342,7 @@
(storew (logior (ash (1- size) n-widetag-bits) closure-widetag)
result 0 fun-pointer-lowtag)))
;; Done with pseudo-atomic
(inst lea temp (make-ea-for-object-slot function simple-fun-insts-offset
(inst lea temp (object-slot-ea function simple-fun-insts-offset
fun-pointer-lowtag))
(storew temp result closure-fun-slot fun-pointer-lowtag)))

View file

@ -372,7 +372,7 @@
;;; And the float variants.
(defun make-ea-for-float-ref (object index offset element-size
(defun float-ref-ea (object index offset element-size
&key (scale 1) (complex-offset 0))
(sc-case index
(immediate
@ -402,7 +402,7 @@
(:result-types single-float)
(:generator 5
(with-empty-tn@fp-top(value)
(inst fld (make-ea-for-float-ref object index offset 4)))))
(inst fld (float-ref-ea object index offset 4)))))
(define-vop (data-vector-set-with-offset/simple-array-single-float)
(:note "inline array store")
@ -421,14 +421,14 @@
(:generator 5
(cond ((zerop (tn-offset value))
;; Value is in ST0.
(inst fst (make-ea-for-float-ref object index offset 4))
(inst fst (float-ref-ea object index offset 4))
(unless (zerop (tn-offset result))
;; Value is in ST0 but not result.
(inst fst result)))
(t
;; Value is not in ST0.
(inst fxch value)
(inst fst (make-ea-for-float-ref object index offset 4))
(inst fst (float-ref-ea object index offset 4))
(cond ((zerop (tn-offset result))
;; The result is in ST0.
(inst fst value))
@ -453,7 +453,7 @@
(:result-types double-float)
(:generator 7
(with-empty-tn@fp-top(value)
(inst fldd (make-ea-for-float-ref object index offset 8 :scale 2)))))
(inst fldd (float-ref-ea object index offset 8 :scale 2)))))
(define-vop (data-vector-set-with-offset/simple-array-double-float)
(:note "inline array store")
@ -472,14 +472,14 @@
(:generator 20
(cond ((zerop (tn-offset value))
;; Value is in ST0.
(inst fstd (make-ea-for-float-ref object index offset 8 :scale 2))
(inst fstd (float-ref-ea object index offset 8 :scale 2))
(unless (zerop (tn-offset result))
;; Value is in ST0 but not result.
(inst fstd result)))
(t
;; Value is not in ST0.
(inst fxch value)
(inst fstd (make-ea-for-float-ref object index offset 8 :scale 2))
(inst fstd (float-ref-ea object index offset 8 :scale 2))
(cond ((zerop (tn-offset result))
;; The result is in ST0.
(inst fstd value))
@ -506,11 +506,11 @@
(:generator 5
(let ((real-tn (complex-single-reg-real-tn value)))
(with-empty-tn@fp-top (real-tn)
(inst fld (make-ea-for-float-ref object index offset 8 :scale 2))))
(inst fld (float-ref-ea object index offset 8 :scale 2))))
(let ((imag-tn (complex-single-reg-imag-tn value)))
(with-empty-tn@fp-top (imag-tn)
;; FIXME
(inst fld (make-ea-for-float-ref object index offset 8
(inst fld (float-ref-ea object index offset 8
:scale 2 :complex-offset 4))))))
(define-vop (data-vector-set-with-offset/simple-array-complex-single-float)
@ -532,14 +532,14 @@
(result-real (complex-single-reg-real-tn result)))
(cond ((zerop (tn-offset value-real))
;; Value is in ST0.
(inst fst (make-ea-for-float-ref object index offset 8 :scale 2))
(inst fst (float-ref-ea object index offset 8 :scale 2))
(unless (zerop (tn-offset result-real))
;; Value is in ST0 but not result.
(inst fst result-real)))
(t
;; Value is not in ST0.
(inst fxch value-real)
(inst fst (make-ea-for-float-ref object index offset 8 :scale 2))
(inst fst (float-ref-ea object index offset 8 :scale 2))
(cond ((zerop (tn-offset result-real))
;; The result is in ST0.
(inst fst value-real))
@ -551,7 +551,7 @@
(let ((value-imag (complex-single-reg-imag-tn value))
(result-imag (complex-single-reg-imag-tn result)))
(inst fxch value-imag)
(inst fst (make-ea-for-float-ref object index offset 8
(inst fst (float-ref-ea object index offset 8
:scale 2 :complex-offset 4))
(unless (location= value-imag result-imag)
(inst fst result-imag))
@ -572,10 +572,10 @@
(:generator 7
(let ((real-tn (complex-double-reg-real-tn value)))
(with-empty-tn@fp-top (real-tn)
(inst fldd (make-ea-for-float-ref object index offset 16 :scale 4)))
(inst fldd (float-ref-ea object index offset 16 :scale 4)))
(let ((imag-tn (complex-double-reg-imag-tn value)))
(with-empty-tn@fp-top (imag-tn)
(inst fldd (make-ea-for-float-ref object index offset 16
(inst fldd (float-ref-ea object index offset 16
:scale 4 :complex-offset 8)))))))
(define-vop (data-vector-set-with-offset/simple-array-complex-double-float)
@ -597,7 +597,7 @@
(result-real (complex-double-reg-real-tn result)))
(cond ((zerop (tn-offset value-real))
;; Value is in ST0.
(inst fstd (make-ea-for-float-ref object index offset 16
(inst fstd (float-ref-ea object index offset 16
:scale 4))
(unless (zerop (tn-offset result-real))
;; Value is in ST0 but not result.
@ -605,7 +605,7 @@
(t
;; Value is not in ST0.
(inst fxch value-real)
(inst fstd (make-ea-for-float-ref object index offset 16
(inst fstd (float-ref-ea object index offset 16
:scale 4))
(cond ((zerop (tn-offset result-real))
;; The result is in ST0.
@ -618,7 +618,7 @@
(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-for-float-ref object index offset 16
(inst fstd (float-ref-ea object index offset 16
:scale 4 :complex-offset 8))
(unless (location= value-imag result-imag)
(inst fstd result-imag))

View file

@ -906,10 +906,10 @@
'(make-ea :dword :disp
(+ nil-value (static-fun-offset fun))))
((t)
'(make-ea-for-object-slot eax fdefn-raw-addr-slot
'(object-slot-ea eax fdefn-raw-addr-slot
other-pointer-lowtag))
((nil)
'(make-ea-for-object-slot eax closure-fun-slot
'(object-slot-ea eax closure-fun-slot
fun-pointer-lowtag))))
,@(ecase return
(:fixed

View file

@ -223,7 +223,7 @@
(:args (object :scs (descriptor-reg)))
(:conditional :ne)
(:generator 9
(inst cmp (make-ea-for-object-slot object symbol-value-slot
(inst cmp (object-slot-ea object symbol-value-slot
other-pointer-lowtag)
unbound-marker-widetag)))

View file

@ -12,7 +12,7 @@
(in-package "SB-VM")
(macrolet ((ea-for-xf-desc (tn slot)
`(make-ea-for-object-slot ,tn ,slot other-pointer-lowtag)))
`(object-slot-ea ,tn ,slot other-pointer-lowtag)))
(defun ea-for-sf-desc (tn)
(ea-for-xf-desc tn single-float-value-slot))
(defun ea-for-df-desc (tn)
@ -1987,7 +1987,7 @@
:disp (frame-byte-offset (tn-offset temp)))))
(descriptor-reg
(inst movsx exp-bits
(make-ea-for-object-slot float (+ 2 long-float-value-slot)
(object-slot-ea float (+ 2 long-float-value-slot)
other-pointer-lowtag :word))))))
#+long-float

View file

@ -49,28 +49,28 @@
;; 16 byte alignment.
`(inst and ,tn -16))
(defmacro make-ea-for-object-slot (ptr slot lowtag &optional (size :dword))
(defmacro object-slot-ea (ptr slot lowtag &optional (size :dword))
`(make-ea ,size :base ,ptr :disp (- (* ,slot n-word-bytes) ,lowtag)))
(defmacro loadw (value ptr &optional (slot 0) (lowtag 0))
`(inst mov ,value (make-ea-for-object-slot ,ptr ,slot ,lowtag)))
`(inst mov ,value (object-slot-ea ,ptr ,slot ,lowtag)))
(defmacro storew (value ptr &optional (slot 0) (lowtag 0))
(once-only ((value value))
`(inst mov (make-ea-for-object-slot ,ptr ,slot ,lowtag) ,value)))
`(inst mov (object-slot-ea ,ptr ,slot ,lowtag) ,value)))
;;; A handy utility for storing widetags.
(defun store-widetag (value ptr &optional (slot 0) (lowtag 0))
(inst mov (make-ea-for-object-slot
(inst mov (object-slot-ea
ptr slot lowtag
(if (typep value '(and integer (not (unsigned-byte 8)))) :word :byte))
value))
(defmacro pushw (ptr &optional (slot 0) (lowtag 0))
`(inst push (make-ea-for-object-slot ,ptr ,slot ,lowtag)))
`(inst push (object-slot-ea ,ptr ,slot ,lowtag)))
(defmacro popw (ptr &optional (slot 0) (lowtag 0))
`(inst pop (make-ea-for-object-slot ,ptr ,slot ,lowtag)))
`(inst pop (object-slot-ea ,ptr ,slot ,lowtag)))
(defmacro make-ea-for-vector-data (object &key (size :dword) (offset 0)
index (scale (ash (width-bits size) -3)))
@ -101,8 +101,7 @@
#+sb-thread
(progn
(defmacro tls-index-of (symbol)
`(make-ea-for-object-slot ,symbol ,sb-vm:symbol-tls-index-slot
,other-pointer-lowtag))
`(object-slot-ea ,symbol ,sb-vm:symbol-tls-index-slot ,other-pointer-lowtag))
(defmacro make-ea-for-symbol-tls-index (symbol)
(declare (type symbol symbol))
`(make-ea :dword

View file

@ -117,7 +117,7 @@
(storew (make-fixup 'uwp-seh-handler :assembly-routine)
uwp unwind-block-seh-frame-handler-slot)
(inst lea seh-frame
(make-ea-for-object-slot uwp
(object-slot-ea uwp
unwind-block-next-seh-frame-slot 0))
(inst mov (make-ea :dword :disp 0) seh-frame :fs))
(store-tl-symbol-value uwp *current-unwind-protect-block* tls)))

View file

@ -235,7 +235,7 @@
(inst lea eax (make-ea :dword :base res :disp (- list-pointer-lowtag)))
(emit-optimized-test-inst eax lowtag-mask)
(inst cmov :e res
(make-ea-for-object-slot res cons-cdr-slot list-pointer-lowtag))))
(object-slot-ea res cons-cdr-slot list-pointer-lowtag))))
(define-vop (symbol-plist)
(:policy :fast-safe)
(:translate symbol-plist)

View file

@ -215,7 +215,7 @@
:disp (- other-pointer-lowtag)))
(inst test al-tn lowtag-mask)
(inst jmp :ne nope)
(inst cmp (make-ea-for-object-slot value 0 other-pointer-lowtag)
(inst cmp (object-slot-ea value 0 other-pointer-lowtag)
(+ (ash 1 n-widetag-bits) bignum-widetag))
(inst jmp (if not-p :ne :e) target))
NOT-TARGET))
@ -253,7 +253,7 @@
(inst sub eax-tn (+ (ash 2 n-widetag-bits) bignum-widetag))
(inst jmp :ne nope)
;; Compare the second digit to zero (in EAX).
(inst cmp (make-ea-for-object-slot value (1+ bignum-digits-offset)
(inst cmp (object-slot-ea value (1+ bignum-digits-offset)
other-pointer-lowtag) eax-tn)
(inst jmp :z yep) ; All zeros, its an (unsigned-byte 32).
(inst jmp nope)