;; Else, value not immediate.
(storew value object offset lowtag))))
;; Else, value not immediate.
(storew value object offset lowtag))))
(define-vop (compare-and-swap-slot)
(:args (object :scs (descriptor-reg) :to :eval)
(old :scs (descriptor-reg any-reg) :target rax)
(define-vop (compare-and-swap-slot)
(:args (object :scs (descriptor-reg) :to :eval)
(old :scs (descriptor-reg any-reg) :target rax)
;; 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)
;; 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)
(:args (function :scs (descriptor-reg) :target result)
(fdefn :scs (descriptor-reg)))
(:temporary (:sc unsigned-reg) raw)
(:args (function :scs (descriptor-reg) :target result)
(fdefn :scs (descriptor-reg)))
(:temporary (:sc unsigned-reg) raw)
NORMAL-FUN
(storew function fdefn fdefn-fun-slot other-pointer-lowtag)
(storew raw fdefn fdefn-raw-addr-slot other-pointer-lowtag)
NORMAL-FUN
(storew function fdefn fdefn-fun-slot other-pointer-lowtag)
(storew raw fdefn fdefn-raw-addr-slot other-pointer-lowtag)
(loadw tls-index symbol symbol-tls-index-slot other-pointer-lowtag)
(inst add bsp (* binding-size n-word-bytes))
(store-binding-stack-pointer bsp)
(loadw tls-index symbol symbol-tls-index-slot other-pointer-lowtag)
(inst add bsp (* binding-size n-word-bytes))
(store-binding-stack-pointer bsp)
- (inst lea temp-reg-tn
- (make-ea :qword :disp
- (make-fixup (ecase (tn-offset tls-index)
- (#.rax-offset 'alloc-tls-index-in-rax)
- (#.rcx-offset 'alloc-tls-index-in-rcx)
- (#.rdx-offset 'alloc-tls-index-in-rdx)
- (#.rbx-offset 'alloc-tls-index-in-rbx)
- (#.rsi-offset 'alloc-tls-index-in-rsi)
- (#.rdi-offset 'alloc-tls-index-in-rdi)
- (#.r8-offset 'alloc-tls-index-in-r8)
- (#.r9-offset 'alloc-tls-index-in-r9)
- (#.r10-offset 'alloc-tls-index-in-r10)
- (#.r12-offset 'alloc-tls-index-in-r12)
- (#.r13-offset 'alloc-tls-index-in-r13)
- (#.r14-offset 'alloc-tls-index-in-r14)
- (#.r15-offset 'alloc-tls-index-in-r15))
- :assembly-routine)))
+ (inst mov temp-reg-tn
+ (make-fixup (ecase (tn-offset tls-index)
+ (#.rax-offset 'alloc-tls-index-in-rax)
+ (#.rcx-offset 'alloc-tls-index-in-rcx)
+ (#.rdx-offset 'alloc-tls-index-in-rdx)
+ (#.rbx-offset 'alloc-tls-index-in-rbx)
+ (#.rsi-offset 'alloc-tls-index-in-rsi)
+ (#.rdi-offset 'alloc-tls-index-in-rdi)
+ (#.r8-offset 'alloc-tls-index-in-r8)
+ (#.r9-offset 'alloc-tls-index-in-r9)
+ (#.r10-offset 'alloc-tls-index-in-r10)
+ (#.r12-offset 'alloc-tls-index-in-r12)
+ (#.r13-offset 'alloc-tls-index-in-r13)
+ (#.r14-offset 'alloc-tls-index-in-r14)
+ (#.r15-offset 'alloc-tls-index-in-r15))
+ :assembly-routine))
(inst call temp-reg-tn)
(emit-label tls-index-valid)
(inst push (make-ea :qword :base thread-base-tn :scale 1 :index tls-index))
(inst call temp-reg-tn)
(emit-label tls-index-valid)
(inst push (make-ea :qword :base thread-base-tn :scale 1 :index tls-index))
(inst jmp :z SKIP)
;; Bind stack debug sentinels have the unbound marker in the symbol slot
(inst cmp symbol unbound-marker-widetag)
(inst jmp :z SKIP)
;; Bind stack debug sentinels have the unbound marker in the symbol slot
(inst cmp symbol unbound-marker-widetag)
(if (integerp instance-length)
;; For RAW-INSTANCE-INIT/* VOPs, which know the exact instance length
;; at compile time.
(if (integerp instance-length)
;; For RAW-INSTANCE-INIT/* VOPs, which know the exact instance length
;; at compile time.
(define-vop (raw-instance-atomic-incf-c/word)
(:translate %raw-instance-atomic-incf/word)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
(define-vop (raw-instance-atomic-incf-c/word)
(:translate %raw-instance-atomic-incf/word)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg))
(:arg-types * (:constant (load/store-index #.n-word-bytes
#.instance-pointer-lowtag
#.instance-slots-offset))
(:arg-types * (:constant (load/store-index #.n-word-bytes
#.instance-pointer-lowtag
#.instance-slots-offset))
- (inst movss (make-ea-for-raw-slot object index tmp) value)
- (unless (location= result value)
- (inst movss result value))))
+ (inst movss (make-ea-for-raw-slot object tmp :scale (ash 1 (- word-shift n-fixnum-tag-bits))) value)
+ (move result value)))
- (inst movsd (make-ea-for-raw-slot object index tmp) value)
- (unless (location= result value)
- (inst movsd result value))))
+ (inst movsd (make-ea-for-raw-slot object tmp :scale (ash 1 (- word-shift n-fixnum-tag-bits))) value)
+ (move result value)))
- (let ((real-tn (complex-single-reg-real-tn value)))
- (inst movss real-tn (make-ea-for-raw-slot object index tmp)))
- (let ((imag-tn (complex-single-reg-imag-tn value)))
- (inst movss imag-tn (make-ea-for-raw-slot object index tmp 4)))))
+ (inst movq value (make-ea-for-raw-slot object tmp :scale (ash 1 (- word-shift n-fixnum-tag-bits))))))
- (let ((real-tn (complex-single-reg-real-tn value)))
- (inst movss real-tn (make-ea-for-raw-slot object index tmp)))
- (let ((imag-tn (complex-single-reg-imag-tn value)))
- (inst movss imag-tn (make-ea-for-raw-slot object index tmp 4)))))
+ (inst movq value (make-ea-for-raw-slot object tmp :index index))))
- (let ((value-real (complex-single-reg-real-tn value))
- (result-real (complex-single-reg-real-tn result)))
- (inst movss (make-ea-for-raw-slot object index tmp) value-real)
- (unless (location= value-real result-real)
- (inst movss result-real value-real)))
- (let ((value-imag (complex-single-reg-imag-tn value))
- (result-imag (complex-single-reg-imag-tn result)))
- (inst movss (make-ea-for-raw-slot object index tmp 4) value-imag)
- (unless (location= value-imag result-imag)
- (inst movss result-imag value-imag)))))
+ (move result value)
+ (inst movq (make-ea-for-raw-slot object tmp :scale (ash 1 (- word-shift n-fixnum-tag-bits))) value)))
- (let ((value-real (complex-single-reg-real-tn value))
- (result-real (complex-single-reg-real-tn result)))
- (inst movss (make-ea-for-raw-slot object index tmp) value-real)
- (unless (location= value-real result-real)
- (inst movss result-real value-real)))
- (let ((value-imag (complex-single-reg-imag-tn value))
- (result-imag (complex-single-reg-imag-tn result)))
- (inst movss (make-ea-for-raw-slot object index tmp 4) value-imag)
- (unless (location= value-imag result-imag)
- (inst movss result-imag value-imag)))))
+ (move result value)
+ (inst movq (make-ea-for-raw-slot object tmp :index index) value)))
- (let ((value-real (complex-single-reg-real-tn value)))
- (inst movss (make-ea-for-raw-slot object index instance-length) value-real))
- (let ((value-imag (complex-single-reg-imag-tn value)))
- (inst movss (make-ea-for-raw-slot object index instance-length 4) value-imag))))
+ (inst movq (make-ea-for-raw-slot object instance-length :index index) value)))
- (let ((real-tn (complex-double-reg-real-tn value)))
- (inst movsd real-tn (make-ea-for-raw-slot object index tmp -8)))
- (let ((imag-tn (complex-double-reg-imag-tn value)))
- (inst movsd imag-tn (make-ea-for-raw-slot object index tmp)))))
+ (inst movdqu value (make-ea-for-raw-slot object tmp :scale (ash 1 (- word-shift n-fixnum-tag-bits)) :adjustment -8))))
- (let ((real-tn (complex-double-reg-real-tn value)))
- (inst movsd real-tn (make-ea-for-raw-slot object index tmp -8)))
- (let ((imag-tn (complex-double-reg-imag-tn value)))
- (inst movsd imag-tn (make-ea-for-raw-slot object index tmp)))))
+ (inst movdqu value (make-ea-for-raw-slot object tmp :index index :adjustment -8))))
- (let ((value-real (complex-double-reg-real-tn value))
- (result-real (complex-double-reg-real-tn result)))
- (inst movsd (make-ea-for-raw-slot object index tmp -8) value-real)
- (unless (location= value-real result-real)
- (inst movsd result-real value-real)))
- (let ((value-imag (complex-double-reg-imag-tn value))
- (result-imag (complex-double-reg-imag-tn result)))
- (inst movsd (make-ea-for-raw-slot object index tmp) value-imag)
- (unless (location= value-imag result-imag)
- (inst movsd result-imag value-imag)))))
+ (move result value)
+ (inst movdqu (make-ea-for-raw-slot object tmp :scale (ash 1 (- word-shift n-fixnum-tag-bits)) :adjustment -8) value)))
- (let ((value-real (complex-double-reg-real-tn value))
- (result-real (complex-double-reg-real-tn result)))
- (inst movsd (make-ea-for-raw-slot object index tmp -8) value-real)
- (unless (location= value-real result-real)
- (inst movsd result-real value-real)))
- (let ((value-imag (complex-double-reg-imag-tn value))
- (result-imag (complex-double-reg-imag-tn result)))
- (inst movsd (make-ea-for-raw-slot object index tmp) value-imag)
- (unless (location= value-imag result-imag)
- (inst movsd result-imag value-imag)))))
+ (move result value)
+ (inst movdqu (make-ea-for-raw-slot object tmp :index index :adjustment -8) value)))
- (let ((value-real (complex-double-reg-real-tn value)))
- (inst movsd (make-ea-for-raw-slot object index instance-length -8) value-real))
- (let ((value-imag (complex-double-reg-imag-tn value)))
- (inst movsd (make-ea-for-raw-slot object index instance-length) value-imag))))
+ (inst movdqu (make-ea-for-raw-slot object instance-length :index index :adjustment -8) value)))