From 8bb7e14a921675eacec2dad00ed3060289cf6538 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 20 Mar 2006 02:49:16 +0000 Subject: [PATCH] 0.9.10.44: Apply Alastair Bridgewater's "Small inefficiency in tl-symbol-value access" patch, sbcl-devel 11-02-2006. ... take care of cases in {c-call,cell}.lisp too. --- NEWS | 3 +++ src/compiler/x86/c-call.lisp | 8 ++++---- src/compiler/x86/cell.lisp | 19 +++++++++---------- src/compiler/x86/macros.lisp | 4 ++-- version.lisp-expr | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index 09e234c..39830be 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ changes in sbcl-0.9.11 relative to sbcl-0.9.10: to be friendlier to the prediction heuristics implemented, particularly with reference to CALL and RET pairing. (thanks to Alastair Bridgewater) + * optimization: on x86, the code for access to thread-local symbol + values and binding/unbinding of thread-local symbols is smaller. + (thanks to Alastair Bridgewater) * enhancement: CONSTANTP is now able to determine constantness of more complex forms, including calls to constant-foldable standardized functions and some special forms beyond QUOTE. diff --git a/src/compiler/x86/c-call.lisp b/src/compiler/x86/c-call.lisp index c52ce27..e441003 100644 --- a/src/compiler/x86/c-call.lisp +++ b/src/compiler/x86/c-call.lisp @@ -306,7 +306,7 @@ (ash symbol-tls-index-slot word-shift) (- other-pointer-lowtag)))) (inst fs-segment-prefix) - (inst sub (make-ea :dword :scale 1 :index temp) delta))) + (inst sub (make-ea :dword :base temp) delta))) (load-tl-symbol-value result *alien-stack*)) #!-sb-thread (:generator 0 @@ -330,12 +330,12 @@ (let ((delta (logandc2 (+ amount 3) 3))) (inst mov temp (make-ea :dword - :disp (+ nil-value - (static-symbol-offset '*alien-stack*) + :disp (+ nil-value + (static-symbol-offset '*alien-stack*) (ash symbol-tls-index-slot word-shift) (- other-pointer-lowtag)))) (inst fs-segment-prefix) - (inst add (make-ea :dword :scale 1 :index temp) delta)))) + (inst add (make-ea :dword :base temp) delta)))) #!-sb-thread (:generator 0 (unless (zerop amount) diff --git a/src/compiler/x86/cell.lisp b/src/compiler/x86/cell.lisp index f2387c7..f844f87 100644 --- a/src/compiler/x86/cell.lisp +++ b/src/compiler/x86/cell.lisp @@ -72,11 +72,10 @@ (inst or tls tls) (inst jmp :z global-val) (inst fs-segment-prefix) - (inst cmp (make-ea :dword :scale 1 :index tls) - no-tls-value-marker-widetag) + (inst cmp (make-ea :dword :base tls) no-tls-value-marker-widetag) (inst jmp :z global-val) (inst fs-segment-prefix) - (inst mov (make-ea :dword :scale 1 :index tls) value) + (inst mov (make-ea :dword :base tls) value) (inst jmp done) (emit-label global-val) (storew value symbol symbol-value-slot other-pointer-lowtag) @@ -113,7 +112,7 @@ (ret-lab (gen-label))) (loadw value object symbol-tls-index-slot other-pointer-lowtag) (inst fs-segment-prefix) - (inst mov value (make-ea :dword :index value :scale 1)) + (inst mov value (make-ea :dword :base value)) (inst cmp value no-tls-value-marker-widetag) (inst jmp :ne check-unbound-label) (loadw value object symbol-value-slot other-pointer-lowtag) @@ -135,7 +134,7 @@ (let ((ret-lab (gen-label))) (loadw value object symbol-tls-index-slot other-pointer-lowtag) (inst fs-segment-prefix) - (inst mov value (make-ea :dword :index value :scale 1)) + (inst mov value (make-ea :dword :base value)) (inst cmp value no-tls-value-marker-widetag) (inst jmp :ne ret-lab) (loadw value object symbol-value-slot other-pointer-lowtag) @@ -192,7 +191,7 @@ (let ((check-unbound-label (gen-label))) (loadw value object symbol-tls-index-slot other-pointer-lowtag) (inst fs-segment-prefix) - (inst mov value (make-ea :dword :index value :scale 1)) + (inst mov value (make-ea :dword :base value)) (inst cmp value no-tls-value-marker-widetag) (inst jmp :ne check-unbound-label) (loadw value object symbol-value-slot other-pointer-lowtag) @@ -323,11 +322,11 @@ (emit-label tls-index-valid) (inst fs-segment-prefix) - (inst mov temp (make-ea :dword :scale 1 :index tls-index)) + (inst mov temp (make-ea :dword :base tls-index)) (storew temp bsp (- binding-value-slot binding-size)) (storew symbol bsp (- binding-symbol-slot binding-size)) (inst fs-segment-prefix) - (inst mov (make-ea :dword :scale 1 :index tls-index) val)))) + (inst mov (make-ea :dword :base tls-index) val)))) #!-sb-thread (define-vop (bind) @@ -355,7 +354,7 @@ (loadw tls-index symbol symbol-tls-index-slot other-pointer-lowtag) (inst fs-segment-prefix) - (inst mov (make-ea :dword :scale 1 :index tls-index) value) + (inst mov (make-ea :dword :base tls-index) value) (storew 0 bsp (- binding-value-slot binding-size)) (storew 0 bsp (- binding-symbol-slot binding-size)) @@ -394,7 +393,7 @@ #!+sb-thread (loadw tls-index symbol symbol-tls-index-slot other-pointer-lowtag) #!+sb-thread (inst fs-segment-prefix) - #!+sb-thread (inst mov (make-ea :dword :scale 1 :index tls-index) value) + #!+sb-thread (inst mov (make-ea :dword :base tls-index) value) (storew 0 bsp (- binding-value-slot binding-size)) (storew 0 bsp (- binding-symbol-slot binding-size)) diff --git a/src/compiler/x86/macros.lisp b/src/compiler/x86/macros.lisp index 8a1dc87..e99bf9b 100644 --- a/src/compiler/x86/macros.lisp +++ b/src/compiler/x86/macros.lisp @@ -93,7 +93,7 @@ `(progn (inst mov ,reg (make-ea-for-symbol-tls-index ,symbol)) (inst fs-segment-prefix) - (inst mov ,reg (make-ea :dword :scale 1 :index ,reg)))) + (inst mov ,reg (make-ea :dword :base ,reg)))) #!-sb-thread (defmacro load-tl-symbol-value (reg symbol) `(load-symbol-value ,reg ,symbol)) @@ -102,7 +102,7 @@ `(progn (inst mov ,temp (make-ea-for-symbol-tls-index ,symbol)) (inst fs-segment-prefix) - (inst mov (make-ea :dword :scale 1 :index ,temp) ,reg))) + (inst mov (make-ea :dword :base ,temp) ,reg))) #!-sb-thread (defmacro store-tl-symbol-value (reg symbol temp) (declare (ignore temp)) diff --git a/version.lisp-expr b/version.lisp-expr index cdd1baa..63ee192 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".) -"0.9.10.43" +"0.9.10.44" -- 1.7.10.4