From: Juho Snellman Date: Sat, 15 Oct 2005 18:58:05 +0000 (+0000) Subject: 0.9.5.68: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;ds=inline;h=7e53ad16e6d2cd5cb22da7e8410f9560019cac19;p=sbcl.git 0.9.5.68: Use the C7 MOV instruction instead of the B8 one for loading small immediates to qword registers on x86-64. (Shaves about 250k off the core.) --- diff --git a/src/compiler/x86-64/insts.lisp b/src/compiler/x86-64/insts.lisp index a8d80e8..66cc03a 100644 --- a/src/compiler/x86-64/insts.lisp +++ b/src/compiler/x86-64/insts.lisp @@ -1420,12 +1420,23 @@ (cond ((register-p dst) (cond ((integerp src) (maybe-emit-rex-prefix segment size nil nil dst) - (emit-byte-with-reg segment - (if (eq size :byte) - #b10110 - #b10111) - (reg-tn-encoding dst)) - (emit-sized-immediate segment size src (eq size :qword))) + (cond ((and (eq size :qword) + (typep src '(signed-byte 31))) + ;; When loading small immediates to a qword register + ;; using B8 wastes 3 bytes compared to C7. + (emit-byte segment #b11000111) + (emit-mod-reg-r/m-byte segment #b11 + #b000 + (reg-tn-encoding dst)) + (emit-sized-immediate segment :dword src nil)) + (t + (emit-byte-with-reg segment + (if (eq size :byte) + #b10110 + #b10111) + (reg-tn-encoding dst)) + (emit-sized-immediate segment size src + (eq size :qword))))) (t (maybe-emit-rex-for-ea segment src dst) (emit-byte segment diff --git a/version.lisp-expr b/version.lisp-expr index c901feb..80ef301 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.5.67" +"0.9.5.68"