From 21d4633297c8b268da044431860172d822ad0bcf Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Fri, 2 Nov 2012 09:42:41 -0400 Subject: [PATCH] compiler/arm/nlx,compiler/ir2tran: VOP NLX-ENTRY-MULTIPLE. * This is used for CATCH and lexical NLX-entry points (BLOCK) when the result is used in a multiple-value context (such as being returned immediately or used in an MV-call). * VOP cribbed from the PPC backend, and the usage site re-enabled. --- src/compiler/arm/nlx.lisp | 37 +++++++++++++++++++++++++++++++++++++ src/compiler/ir2tran.lisp | 3 --- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/compiler/arm/nlx.lisp b/src/compiler/arm/nlx.lisp index 391e5b567..de2eeb1a3 100644 --- a/src/compiler/arm/nlx.lisp +++ b/src/compiler/arm/nlx.lisp @@ -154,3 +154,40 @@ (store-stack-tn tn move-temp :ge) (store-stack-tn tn null-tn :lt))))))) (load-stack-tn sp-tn sp))) + +(define-vop (nlx-entry-multiple) + (:args (top :target result) (src) (count)) + ;; Again, no SC restrictions for the args, 'cause the loading would + ;; happen before the entry label. + (:info label) + (:temporary (:scs (any-reg)) dst) + (:temporary (:scs (descriptor-reg)) temp) + (:results (result :scs (any-reg) :from (:argument 0)) + (num :scs (any-reg) :from (:argument 0))) + (:save-p :force-to-stack) + (:vop-var vop) + (:generator 30 + (emit-return-pc label) + (note-this-location vop :non-local-entry) + + ;; Setup results, and test for the zero value case. + (load-stack-tn result top) + (inst cmp count 0) + (inst mov num 0) + (inst b :eq DONE) + + ;; Compute dst as one slot down from result, because we inc the index + ;; before we use it. + (inst sub dst result 4) + + ;; Copy stuff down the stack. + LOOP + (inst ldr temp (@ src num)) + (inst add num num (fixnumize 1)) + (inst cmp num count) + (inst str temp (@ dst num)) + (inst b :ne LOOP) + + ;; Reset the CSP. + DONE + (inst add sp-tn result num))) diff --git a/src/compiler/ir2tran.lisp b/src/compiler/ir2tran.lisp index 8bba94730..f8b237b59 100644 --- a/src/compiler/ir2tran.lisp +++ b/src/compiler/ir2tran.lisp @@ -1795,9 +1795,6 @@ ((:catch :block :tagbody) (let ((2lvar (and lvar (lvar-info lvar)))) (if (and 2lvar (eq (ir2-lvar-kind 2lvar) :unknown)) - #!+arm - (error "Don't know how to VOP NLX-ENTRY-MULTIPLE") - #!-arm (vop* nlx-entry-multiple node block (top-loc start-loc count-loc nil) ((reference-tn-list (ir2-lvar-locs 2lvar) t)) -- 2.11.4.GIT