-
- ;; Copy args.
- (load-stack-tn dst top)
- (move start src)
- (move count num)
-
- ;; Establish results.
- (sc-case new-start
- (any-reg (move dst new-start))
- (control-stack (store-stack-tn new-start dst)))
- (inst comb := num zero-tn done)
- (sc-case new-count
- (any-reg (inst move num new-count))
- (control-stack (store-stack-tn new-count num)))
- ;; Load the first word.
- (inst ldwm n-word-bytes src temp)
-
- ;; Copy stuff on stack.
- LOOP
- (inst stwm temp n-word-bytes dst)
- (inst addib :<> (fixnumize -1) num loop :nullify t)
- (inst ldwm n-word-bytes src temp)
-
- DONE
- (inst move dst csp-tn)))
-
+ (let ((loop (gen-label))
+ (done (gen-label)))
+
+ ;; Copy args.
+ (load-stack-tn dst top)
+ (move start src)
+ (move count num)
+
+ ;; Establish results.
+ (sc-case new-start
+ (any-reg (move dst new-start))
+ (control-stack (store-stack-tn new-start dst)))
+ (inst comb := num zero-tn done :nullify t)
+ (sc-case new-count
+ (any-reg (move num new-count))
+ (control-stack (store-stack-tn new-count num)))
+
+ ;; Copy stuff on stack.
+ (emit-label loop)
+ (inst ldwm n-word-bytes src temp)
+ (inst addib :<> (fixnumize -1) num loop)
+ (inst stwm temp n-word-bytes dst)
+
+ (emit-label done)
+ (move dst csp-tn))))