From: Nathan Froyd Date: Sat, 6 Oct 2012 04:04:25 +0000 (-0400) Subject: x86-64: micro-optimize LEA DWORD-REG,EA X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=396a1ccf67f18e8fc56a7b2e83e33b35760e59de;hp=3cd0a9aafc20ce12075f38ebaed86676c922fde2;p=sbcl.git x86-64: micro-optimize LEA DWORD-REG,EA If we are loading a DWORD EA into a DWORD register, we may not need the REX prefix. Unlikely to occur in current SBCL code, but does come up when you're writing your own VOPs for 32-bit operations. --- diff --git a/src/compiler/x86-64/insts.lisp b/src/compiler/x86-64/insts.lisp index a23f5f6..15efc7d 100644 --- a/src/compiler/x86-64/insts.lisp +++ b/src/compiler/x86-64/insts.lisp @@ -1799,7 +1799,7 @@ (:emitter (aver (or (dword-reg-p dst) (qword-reg-p dst))) (maybe-emit-rex-for-ea segment src dst - :operand-size :qword) + :operand-size (if (dword-reg-p dst) :dword :qword)) (emit-byte segment #b10001101) (emit-ea segment src (reg-tn-encoding dst))))