X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fmips%2Fsubprim.lisp;h=4bd07b702a6f90bad3956f0ed36f83b79abb461f;hb=6dc30bee17d029acf6bb6da730f03e63b2a01948;hp=1e32827acd73d88d4e7c7538b4ba3f41d09b8c04;hpb=52cfe54802db8736f1f4e2b67764c43bba9b78b3;p=sbcl.git diff --git a/src/compiler/mips/subprim.lisp b/src/compiler/mips/subprim.lisp index 1e32827..4bd07b7 100644 --- a/src/compiler/mips/subprim.lisp +++ b/src/compiler/mips/subprim.lisp @@ -17,31 +17,29 @@ (:vop-var vop) (:save-p :compute-only) (:generator 50 - (move ptr object) - (move count zero-tn) + (let ((done (gen-label)) + (loop (gen-label)) + (not-list (gen-label))) + (move ptr object) + (move count zero-tn) - LOOP + (emit-label loop) - (inst beq ptr null-tn done) - (inst nop) + (inst beq ptr null-tn done) + (inst and temp ptr lowtag-mask) + (inst xor temp list-pointer-lowtag) + (inst bne temp not-list) + (inst nop) - (inst and temp ptr lowtag-mask) - (inst xor temp list-pointer-lowtag) - (inst bne temp zero-tn not-list) - (inst nop) + (loadw ptr ptr cons-cdr-slot list-pointer-lowtag) + (inst b loop) + (inst addu count count (fixnumize 1)) - (loadw ptr ptr cons-cdr-slot list-pointer-lowtag) - (inst b loop) - (inst addu count count (fixnumize 1)) + (emit-label not-list) + (cerror-call vop done object-not-list-error ptr) - NOT-LIST - (cerror-call vop done object-not-list-error ptr) - - DONE - (move result count))) + (emit-label done) + (move result count)))) (define-static-fun length (object) :translate length) - - -