From: Nathan Froyd Date: Sun, 28 May 2006 03:25:51 +0000 (+0000) Subject: 0.9.13.1: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=eab34acb91a5e2b499fc92a84f5f6ffd31ff067c;p=sbcl.git 0.9.13.1: Improve SAP ref/set VOPs, inspired by Alistair Bridgewater's comments in #lisp: ... MOV{S,Z}X can take EAs; don't bother with a temporary (the equivalent VOPs for DATA-VECTOR-REF already did this; so much for OAOO...); ... take this opportunity to consolidate VOPs and shrink the core. --- diff --git a/src/compiler/x86/sap.lisp b/src/compiler/x86/sap.lisp index b0115a8..b1454a0 100644 --- a/src/compiler/x86/sap.lisp +++ b/src/compiler/x86/sap.lisp @@ -158,46 +158,28 @@ (:translate ,ref-name) (:policy :fast-safe) (:args (sap :scs (sap-reg)) - (offset :scs (signed-reg))) + (offset :scs (signed-reg immediate))) (:arg-types system-area-pointer signed-num) - ,@(unless (eq size :dword) - `((:temporary (:sc ,temp-sc - :from (:eval 0) - :to (:eval 1)) - temp))) (:results (result :scs (,sc))) (:result-types ,type) (:generator 5 - (inst mov ,(if (eq size :dword) 'result 'temp) - (make-ea ,size :base sap :index offset)) - ,@(unless (eq size :dword) - `((inst ,(if signed 'movsx 'movzx) - result temp))))) - (define-vop (,ref-name-c) - (:translate ,ref-name) - (:policy :fast-safe) - (:args (sap :scs (sap-reg))) - (:arg-types system-area-pointer - (:constant (signed-byte 32))) - (:info offset) - ,@(unless (eq size :dword) - `((:temporary (:sc ,temp-sc - :from (:eval 0) - :to (:eval 1)) - temp))) - (:results (result :scs (,sc))) - (:result-types ,type) - (:generator 4 - (inst mov ,(if (eq size :dword) 'result 'temp) - (make-ea ,size :base sap :disp offset)) - ,@(unless (eq size :dword) - `((inst ,(if signed 'movsx 'movzx) - result temp))))) + ,(let ((mov-inst (cond + ((eq size :dword) 'mov) + (signed 'movsx) + (t 'movzx)))) + `(sc-case offset + (immediate + (inst ,mov-inst result + (make-ea ,size :base sap + :disp (tn-value offset)))) + (t (inst ,mov-inst result + (make-ea ,size :base sap + :index offset))))))) (define-vop (,set-name) (:translate ,set-name) (:policy :fast-safe) (:args (sap :scs (sap-reg) :to (:eval 0)) - (offset :scs (signed-reg) :to (:eval 0)) + (offset :scs (signed-reg immediate) :to (:eval 0)) (value :scs (,sc) :target ,(if (eq size :dword) 'result @@ -213,39 +195,16 @@ (:generator 5 ,@(unless (eq size :dword) `((move eax-tn value))) - (inst mov (make-ea ,size - :base sap - :index offset) + (inst mov (sc-case offset + (immediate + (make-ea ,size :base sap + :disp (tn-value offset))) + (t (make-ea ,size + :base sap + :index offset))) ,(if (eq size :dword) 'value 'temp)) (move result - ,(if (eq size :dword) 'value 'eax-tn)))) - (define-vop (,set-name-c) - (:translate ,set-name) - (:policy :fast-safe) - (:args (sap :scs (sap-reg) :to (:eval 0)) - (value :scs (,sc) - :target ,(if (eq size :dword) - 'result - 'temp))) - (:arg-types system-area-pointer - (:constant (signed-byte 32)) ,type) - (:info offset) - ,@(unless (eq size :dword) - `((:temporary (:sc ,temp-sc :offset eax-offset - :from (:argument 2) :to (:result 0) - :target result) - temp))) - (:results (result :scs (,sc))) - (:result-types ,type) - (:generator 4 - ,@(unless (eq size :dword) - `((move eax-tn value))) - (inst mov - (make-ea ,size :base sap :disp offset) - ,(if (eq size :dword) 'value 'temp)) - (move result ,(if (eq size :dword) - 'value - 'eax-tn)))))))) + ,(if (eq size :dword) 'value 'eax-tn)))))))) (def-system-ref-and-set sap-ref-8 %set-sap-ref-8 unsigned-reg positive-fixnum :byte nil) diff --git a/version.lisp-expr b/version.lisp-expr index 76183a7..f3df9a5 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.13" +"0.9.13.1"