From 5f0cfcf9095f2d8dbca4ddf703c580a36d5c3709 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Thu, 5 Sep 2013 02:10:19 +0400 Subject: [PATCH] Micro-optimize calling assembly routines on x86oids. Do not check for multiple values in the :full-call return sequence, it always returns just one value and CLC is issued before returning. --- src/assembly/x86-64/arith.lisp | 4 +--- src/assembly/x86-64/support.lisp | 3 +-- src/assembly/x86/arith.lisp | 4 +--- src/assembly/x86/support.lisp | 10 +--------- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/assembly/x86-64/arith.lisp b/src/assembly/x86-64/arith.lisp index c0c773f..6a1fe24 100644 --- a/src/assembly/x86-64/arith.lisp +++ b/src/assembly/x86-64/arith.lisp @@ -21,9 +21,7 @@ (:policy :safe) (:save-p t)) ((:arg x (descriptor-reg any-reg) rdx-offset) - (:arg y (descriptor-reg any-reg) - ;; this seems wrong esi-offset -- FIXME: What's it mean? - rdi-offset) + (:arg y (descriptor-reg any-reg) rdi-offset) (:res res (descriptor-reg any-reg) rdx-offset) diff --git a/src/assembly/x86-64/support.lisp b/src/assembly/x86-64/support.lisp index 1bd5887..62bc41f 100644 --- a/src/assembly/x86-64/support.lisp +++ b/src/assembly/x86-64/support.lisp @@ -21,8 +21,7 @@ `((note-this-location ,vop :call-site) (inst mov temp-reg-tn (make-fixup ',name :assembly-routine)) (inst call temp-reg-tn) - (note-this-location ,vop :single-value-return) - (inst cmov :c rsp-tn rbx-tn)) + (note-this-location ,vop :single-value-return)) '((:save-p :compute-only)))) (:none (values diff --git a/src/assembly/x86/arith.lisp b/src/assembly/x86/arith.lisp index 52b3efc..ea10b50 100644 --- a/src/assembly/x86/arith.lisp +++ b/src/assembly/x86/arith.lisp @@ -21,9 +21,7 @@ (:policy :safe) (:save-p t)) ((:arg x (descriptor-reg any-reg) edx-offset) - (:arg y (descriptor-reg any-reg) - ;; this seems wrong esi-offset -- FIXME: What's it mean? - edi-offset) + (:arg y (descriptor-reg any-reg) edi-offset) (:res res (descriptor-reg any-reg) edx-offset) diff --git a/src/assembly/x86/support.lisp b/src/assembly/x86/support.lisp index 7985f7c..5c28593 100644 --- a/src/assembly/x86/support.lisp +++ b/src/assembly/x86/support.lisp @@ -33,15 +33,7 @@ (values `((note-this-location ,vop :call-site) (inst call (make-fixup ',name :assembly-routine)) - (note-this-location ,vop :single-value-return) - (cond - ((member :cmov *backend-subfeatures*) - (inst cmov :c esp-tn ebx-tn)) - (t - (let ((single-value (gen-label))) - (inst jmp :nc single-value) - (move esp-tn ebx-tn) - (emit-label single-value))))) + (note-this-location ,vop :single-value-return)) '((:save-p :compute-only)))))) (defun generate-return-sequence (style) -- 1.7.10.4