From: Alastair Bridgewater Date: Sun, 8 Aug 2010 01:11:27 +0000 (+0000) Subject: 1.0.41.30: ppc: Add thread-local symbol-value accessor macros. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e55399309ccb6c40b7ec4841c610d31c3fd487b6;p=sbcl.git 1.0.41.30: ppc: Add thread-local symbol-value accessor macros. * This is basically a straight rip of the x86-64 version. * These macros can only be used on static-symbols, so why aren't we pre-allocating their TLS indices and making them available at cross-compile time? If we did, we could elide a temp register on stores and a memory read on all accesses. --- diff --git a/src/compiler/ppc/macros.lisp b/src/compiler/ppc/macros.lisp index 8b70474..bb8a734 100644 --- a/src/compiler/ppc/macros.lisp +++ b/src/compiler/ppc/macros.lisp @@ -55,7 +55,37 @@ (ash ,',offset word-shift) (- other-pointer-lowtag)))))))) (frob value) - (frob function)) + (frob function) + + ;; FIXME: These are only good for static-symbols, so why not + ;; statically-allocate the static-symbol TLS slot indices at + ;; cross-compile time so we can just use a fixed offset within the + ;; TLS block instead of mucking about with the extra memory access + ;; (and temp register, for stores)? + #!+sb-thread + (defmacro load-tl-symbol-value (reg symbol) + `(progn + (inst lwz ,reg null-tn + (+ (static-symbol-offset ',symbol) + (ash symbol-tls-index-slot word-shift) + (- other-pointer-lowtag))) + (inst lwzx ,reg thread-base-tn ,reg))) + #!-sb-thread + (defmacro load-tl-symbol-value (reg symbol) + `(load-symbol-value ,reg ,symbol)) + + #!+sb-thread + (defmacro store-tl-symbol-value (reg symbol temp) + `(progn + (inst lwz ,temp null-tn + (+ (static-symbol-offset ',symbol) + (ash symbol-tls-index-slot word-shift) + (- other-pointer-lowtag))) + (inst stwx ,reg thread-base-tn ,temp))) + #!-sb-thread + (defmacro store-tl-symbol-value (reg symbol temp) + (declare (ignore temp)) + `(store-symbol-value ,reg ,symbol))) (defmacro load-type (target source &optional (offset 0)) "Loads the type bits of a pointer into target independent of diff --git a/version.lisp-expr b/version.lisp-expr index 3117bd9..3c02e38 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.41.29" +"1.0.41.30"