From: lisphacker Date: Thu, 12 Apr 2007 02:28:52 +0000 (+0000) Subject: 1.0.4.70: more x86 backend cleanups X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=2e28fe9a277201b4b96f052794b8eeaaccf9aa95;p=sbcl.git 1.0.4.70: more x86 backend cleanups * Use make-ea-for-FOO macros instead of make-ea with complex displacement in many places. --- diff --git a/src/compiler/x86/arith.lisp b/src/compiler/x86/arith.lisp index ad66b62..fc8651c 100644 --- a/src/compiler/x86/arith.lisp +++ b/src/compiler/x86/arith.lisp @@ -1738,10 +1738,7 @@ (:results (y :scs (unsigned-reg) :from (:eval 0))) (:result-types unsigned-num) (:generator 50 - (inst mov k (make-ea :dword :base state - :disp (- (* (+ 2 vector-data-offset) - n-word-bytes) - other-pointer-lowtag))) + (loadw k state (+ 2 vector-data-offset) other-pointer-lowtag) (inst cmp k 624) (inst jmp :ne no-update) (inst mov tmp state) ; The state is passed in EAX. @@ -1764,11 +1761,7 @@ (inst mov tmp y) (inst inc k) (inst shl tmp 7) - (inst mov (make-ea :dword :base state - :disp (- (* (+ 2 vector-data-offset) - n-word-bytes) - other-pointer-lowtag)) - k) + (storew k state (+ 2 vector-data-offset) other-pointer-lowtag) (inst and tmp #x9d2c5680) (inst xor y tmp) ;; y ^= (y << 15) & #xefc60000 diff --git a/src/compiler/x86/array.lisp b/src/compiler/x86/array.lisp index 3926463..b0df555 100644 --- a/src/compiler/x86/array.lisp +++ b/src/compiler/x86/array.lisp @@ -263,11 +263,7 @@ (:temporary (:sc unsigned-reg :to (:result 0)) old) (:generator 20 (multiple-value-bind (word extra) (floor index ,elements-per-word) - (inst mov old - (make-ea :dword :base object - :disp (- (* (+ word vector-data-offset) - n-word-bytes) - other-pointer-lowtag))) + (loadw old object (+ word vector-data-offset) other-pointer-lowtag) (sc-case value (immediate (let* ((value (tn-value value)) @@ -286,11 +282,7 @@ (inst or old value) (unless (zerop shift) (inst rol old shift))))) - (inst mov (make-ea :dword :base object - :disp (- (* (+ word vector-data-offset) - n-word-bytes) - other-pointer-lowtag)) - old) + (storew old object (+ word vector-data-offset) other-pointer-lowtag) (sc-case value (immediate (inst mov result (tn-value value))) diff --git a/src/compiler/x86/c-call.lisp b/src/compiler/x86/c-call.lisp index c07deae..ae4a9b6 100644 --- a/src/compiler/x86/c-call.lisp +++ b/src/compiler/x86/c-call.lisp @@ -316,11 +316,7 @@ (unless (zerop amount) (let ((delta (logandc2 (+ amount 3) 3))) (inst mov temp - (make-ea :dword - :disp (+ nil-value - (static-symbol-offset '*alien-stack*) - (ash symbol-tls-index-slot word-shift) - (- other-pointer-lowtag)))) + (make-ea-for-symbol-tls-index *alien-stack*)) (inst fs-segment-prefix) (inst sub (make-ea :dword :base temp) delta))) (load-tl-symbol-value result *alien-stack*)) @@ -329,11 +325,7 @@ (aver (not (location= result esp-tn))) (unless (zerop amount) (let ((delta (logandc2 (+ amount 3) 3))) - (inst sub (make-ea :dword - :disp (+ nil-value - (static-symbol-offset '*alien-stack*) - (ash symbol-value-slot word-shift) - (- other-pointer-lowtag))) + (inst sub (make-ea-for-symbol-value *alien-stack*) delta))) (load-symbol-value result *alien-stack*))) @@ -345,22 +337,14 @@ (unless (zerop amount) (let ((delta (logandc2 (+ amount 3) 3))) (inst mov temp - (make-ea :dword - :disp (+ nil-value - (static-symbol-offset '*alien-stack*) - (ash symbol-tls-index-slot word-shift) - (- other-pointer-lowtag)))) + (make-ea-for-symbol-tls-index *alien-stack*)) (inst fs-segment-prefix) (inst add (make-ea :dword :base temp) delta)))) #!-sb-thread (:generator 0 (unless (zerop amount) (let ((delta (logandc2 (+ amount 3) 3))) - (inst add (make-ea :dword - :disp (+ nil-value - (static-symbol-offset '*alien-stack*) - (ash symbol-value-slot word-shift) - (- other-pointer-lowtag))) + (inst add (make-ea-for-symbol-value *alien-stack*) delta))))) ;;; these are not strictly part of the c-call convention, but are diff --git a/src/compiler/x86/call.lisp b/src/compiler/x86/call.lisp index 85d4452..6bd5775 100644 --- a/src/compiler/x86/call.lisp +++ b/src/compiler/x86/call.lisp @@ -902,13 +902,11 @@ (note-this-location vop :call-site) (inst ,(if (eq return :tail) 'jmp 'call) - (make-ea :dword :base eax - :disp ,(if named - '(- (* fdefn-raw-addr-slot - n-word-bytes) - other-pointer-lowtag) - '(- (* closure-fun-slot n-word-bytes) - fun-pointer-lowtag)))) + ,(if named + '(make-ea-for-object-slot eax fdefn-raw-addr-slot + other-pointer-lowtag) + '(make-ea-for-object-slot eax closure-fun-slot + fun-pointer-lowtag))) ,@(ecase return (:fixed '((default-unknown-values vop values nvals))) @@ -1478,11 +1476,7 @@ :disp (* thread-stepping-slot n-word-bytes)) nil-value)) #!-sb-thread - (inst cmp (make-ea :dword - :disp (+ nil-value (static-symbol-offset - 'sb!impl::*stepping*) - (* symbol-value-slot n-word-bytes) - (- other-pointer-lowtag))) + (inst cmp (make-ea-for-symbol-value sb!impl::*stepping*) nil-value)) (define-vop (step-instrument-before-vop) diff --git a/src/compiler/x86/cell.lisp b/src/compiler/x86/cell.lisp index 5a549f5..d1bc473 100644 --- a/src/compiler/x86/cell.lisp +++ b/src/compiler/x86/cell.lisp @@ -164,9 +164,8 @@ (:generator 4 (move result value) (inst lock) - (inst add (make-ea :dword :base object - :disp (- (* symbol-value-slot n-word-bytes) - other-pointer-lowtag)) + (inst add (make-ea-for-object-slot object symbol-value-slot + other-pointer-lowtag) value))) #!+sb-thread @@ -244,9 +243,8 @@ (:generator 38 (load-type type function (- fun-pointer-lowtag)) (inst lea raw - (make-ea :byte :base function - :disp (- (* simple-fun-code-offset n-word-bytes) - fun-pointer-lowtag))) + (make-ea-for-object-slot function simple-fun-code-offset + fun-pointer-lowtag)) (inst cmp type simple-fun-header-widetag) (inst jmp :e normal-fn) (inst lea raw (make-fixup "closure_tramp" :foreign)) diff --git a/src/compiler/x86/float.lisp b/src/compiler/x86/float.lisp index cd2c3ba..fd69f80 100644 --- a/src/compiler/x86/float.lisp +++ b/src/compiler/x86/float.lisp @@ -12,10 +12,7 @@ (in-package "SB!VM") (macrolet ((ea-for-xf-desc (tn slot) - `(make-ea - :dword :base ,tn - :disp (- (* ,slot n-word-bytes) - other-pointer-lowtag)))) + `(make-ea-for-object-slot ,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) @@ -1966,10 +1963,8 @@ :disp (frame-byte-offset (tn-offset temp))))) (descriptor-reg (inst movsx exp-bits - (make-ea :word :base float - :disp (- (* (+ 2 long-float-value-slot) - n-word-bytes) - other-pointer-lowtag))))))) + (make-ea-for-object-slot float (+ 2 long-float-value-slot) + other-pointer-lowtag :word)))))) #!+long-float (define-vop (long-float-high-bits) diff --git a/src/compiler/x86/memory.lisp b/src/compiler/x86/memory.lisp index 6f5ef02..2d89272 100644 --- a/src/compiler/x86/memory.lisp +++ b/src/compiler/x86/memory.lisp @@ -78,8 +78,7 @@ (:policy :fast-safe) (:generator 4 (move result value) - (inst xadd (make-ea :dword :base object - :disp (- (* offset n-word-bytes) lowtag)) + (inst xadd (make-ea-for-object-slot object offset lowtag) value))) ;;; SLOT-REF and SLOT-SET are used to define VOPs like CLOSURE-REF, @@ -102,21 +101,15 @@ (let ((val (tn-value value))) (etypecase val (integer - (inst mov - (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) - (fixnumize val))) + (storew (fixnumize val) + object (+ base offset) lowtag)) (symbol - (inst mov - (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) - (+ nil-value (static-symbol-offset val)))) + (storew (+ nil-value (static-symbol-offset val)) + object (+ base offset) lowtag)) (character - (inst mov - (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) - (logior (ash (char-code val) n-widetag-bits) - character-widetag))))) + (storew (logior (ash (char-code val) n-widetag-bits) + character-widetag) + object (+ base offset) lowtag)))) ;; Else, value not immediate. (storew value object (+ base offset) lowtag)))) @@ -133,8 +126,7 @@ (:generator 4 (move eax old-value) (move temp new-value) - (inst cmpxchg (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) + (inst cmpxchg (make-ea-for-object-slot object (+ base offset) lowtag) temp) (move result eax))) @@ -148,6 +140,5 @@ (:info offset) (:generator 4 (move result value) - (inst xadd (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) + (inst xadd (make-ea-for-object-slot object (+ base offset) lowtag) value))) diff --git a/src/compiler/x86/system.lisp b/src/compiler/x86/system.lisp index 67bf3a3..f3a65a3 100644 --- a/src/compiler/x86/system.lisp +++ b/src/compiler/x86/system.lisp @@ -293,6 +293,6 @@ (:args (count-vector :scs (descriptor-reg))) (:info index) (:generator 0 - (inst inc (make-ea :dword :base count-vector - :disp (- (* (+ vector-data-offset index) n-word-bytes) - other-pointer-lowtag))))) + (inst inc (make-ea-for-object-slot count-vector + (+ vector-data-offset index) + other-pointer-lowtag)))) diff --git a/version.lisp-expr b/version.lisp-expr index 33d2cb4..2897c50 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".) -"1.0.4.69" +"1.0.4.70"