(delete-dead-registers!)
(allocate-alias-register! register (register-type register)))
+(define (general-temporary!)
+ (allocate-temporary-register! 'GENERAL))
+
(define (standard-move-to-temporary! source)
(if (eq? source 'Z)
- (let ((temp (allocate-temporary-register! 'GENERAL)))
+ ;; XXX What about float? Should maybe rename this to
+ ;; GENERAL-MOVE-TO-TEMPORARY!.
+ (let ((temp (general-temporary!)))
(prefix-instructions! (LAP (MOVZ X ,temp (&U 0))))
temp)
(move-to-temporary-register! source (register-type source))))
(fits-in-unsigned-12? (shift-right (- imm) 12)))
(sub `(LSL (&U ,(- imm)) 12)))
(else
- (let ((temp (allocate-temporary-register! 'GENERAL)))
+ (let ((temp (get-temporary)))
(LAP ,@(load-unsigned-immediate temp imm)
,@(add temp))))))
\f
(assert (= 8 address-units-per-object))
(let* ((temp1 regnum:scratch-0)
(temp2 regnum:scratch-1)
- (index (allocate-temporary-register! 'GENERAL))
+ (index (general-temporary!))
(label (generate-label 'MOVE-LOOP))
;; Unroll an odd element if there is one; then do an even
;; number of iterations.
(let loop ((n frame-size) (temps '()))
(if (zero? n)
temps
- (let ((temp (allocate-temporary-register! 'GENERAL)))
+ (let ((temp (general-temporary!)))
(loop (- n 1) (cons temp temps)))))))
(LAP ,@(let loop ((temps temps))
;; (pop2 r1 r2) (pop2 r3 r4) (pop r5)
\f
(define (generate/cons-closure target label min max size)
(let* ((target (standard-target! target))
- (temp (allocate-temporary-register! 'GENERAL))
+ (temp (general-temporary!))
(manifest-type type-code:manifest-closure)
(manifest-size (closure-manifest-size size))
(Free regnum:free-pointer)
;; offsets without pre/post-increment.
,@(add-immediate Free Free (* 8 size))
;; Set the last component to be the relocation reference point.
- ,@(affix-type temp type-code:compiled-entry target
- (lambda () (allocate-temporary-register! 'GENERAL)))
+ ,@(affix-type temp type-code:compiled-entry target general-temporary!)
(STR X ,temp (POST+ ,Free (& 8))))))
(define (generate/cons-multiclosure target nentries size entries)
(let* ((target (standard-target! target))
- (temp (allocate-temporary-register! 'GENERAL))
+ (temp (general-temporary!))
(manifest-type type-code:manifest-closure)
(manifest-size (multiclosure-manifest-size nentries size))
;; 1 for manifest, 1 for padding & format word, 1 for PC offset.
;; offsets without pre/post-increment.
,@(add-immediate Free Free (* 8 size))
;; Set the last component to be the relocation reference point.
- ,@(affix-type temp type-code:compiled-entry target
- (lambda () (allocate-temporary-register! 'GENERAL)))
+ ,@(affix-type temp type-code:compiled-entry target general-temporary!)
(STR X ,temp (POST+ ,Free (& 8))))))
\f
(define (generate-closure-entry label padding min max offset temp)