From 4d132b6acf722b3cd1672477d6371224f22c9b27 Mon Sep 17 00:00:00 2001 From: Lutz Euler Date: Tue, 17 Apr 2012 18:26:48 +0200 Subject: [PATCH] Micro-optimize LENGTH/LIST and VALUES-LIST on x86-64 for code size. As already common in several other places prefer a 32-bit temporary over a 64-bit one for type checking in these VOPs to possibly spare a REX prefix. --- src/compiler/x86-64/subprim.lisp | 4 ++-- src/compiler/x86-64/values.lisp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/x86-64/subprim.lisp b/src/compiler/x86-64/subprim.lisp index 1f44f03..b30b3d1 100644 --- a/src/compiler/x86-64/subprim.lisp +++ b/src/compiler/x86-64/subprim.lisp @@ -18,7 +18,7 @@ (:translate length) (:args (object :scs (descriptor-reg control-stack) :target ptr)) (:arg-types list) - (:temporary (:sc unsigned-reg :offset eax-offset) eax) + (:temporary (:sc dword-reg :offset eax-offset) eax) (:temporary (:sc descriptor-reg :from (:argument 0)) ptr) (:results (count :scs (any-reg))) (:result-types positive-fixnum) @@ -43,7 +43,7 @@ (inst jmp :e DONE) ;; Otherwise, check to see whether we hit the end of a dotted list. If ;; not, loop back for more. - (move eax ptr) + (move eax (make-dword-tn ptr)) (inst and al-tn lowtag-mask) (inst cmp al-tn list-pointer-lowtag) (inst jmp :e LOOP) diff --git a/src/compiler/x86-64/values.lisp b/src/compiler/x86-64/values.lisp index 0ea0535..658815f 100644 --- a/src/compiler/x86-64/values.lisp +++ b/src/compiler/x86-64/values.lisp @@ -76,7 +76,7 @@ (count :scs (any-reg))) (:temporary (:sc descriptor-reg :from (:argument 0) :to (:result 1)) list) (:temporary (:sc descriptor-reg :to (:result 1)) nil-temp) - (:temporary (:sc unsigned-reg :offset rax-offset :to (:result 1)) rax) + (:temporary (:sc dword-reg :offset eax-offset :to (:result 1)) eax) (:vop-var vop) (:save-p :compute-only) (:generator 0 @@ -89,7 +89,7 @@ (inst jmp :e DONE) (pushw list cons-car-slot list-pointer-lowtag) (loadw list list cons-cdr-slot list-pointer-lowtag) - (inst mov rax list) + (inst mov eax (make-dword-tn list)) (inst and al-tn lowtag-mask) (inst cmp al-tn list-pointer-lowtag) (inst jmp :e LOOP) -- 1.7.10.4