(define-rule predicate
(PRED-1-ARG INDEX-FIXNUM? (REGISTER (? register)))
- (define (operate temp source)
+ (let* ((source (standard-source! register))
+ (temp regnum:scratch-0))
(set-equal-branches!)
(LAP (LSR X ,temp ,source (&U ,(- scheme-datum-width 1)))
- (CMP X ,temp (&U ,(* 2 type-code:fixnum)))))
- ;; This basically is WITH-TEMPORARY-REGISTER-COPY! but without
- ;; register references getting in the way.
- (reuse-pseudo-register-alias! register 'GENERAL
- (lambda (temp)
- (need-register! temp)
- (operate temp temp))
- (lambda ()
- (let* ((source (standard-source! register))
- (temp (allocate-temporary-register! 'GENERAL)))
- (operate temp source)))))
+ (CMP X ,temp (&U ,(* 2 type-code:fixnum))))))
(define (zero-test! register)
(set-equal-zero-branches! register)
(assert (>= frame-size 2))
(assert (fits-in-unsigned-12? (* 8 frame-size))) ;XXX
(assert (= 8 address-units-per-object))
- (let* ((temp1 (allocate-temporary-register! 'GENERAL))
- (temp2 (allocate-temporary-register! 'GENERAL))
+ (let* ((temp1 regnum:scratch-0)
+ (temp2 regnum:scratch-1)
(index (allocate-temporary-register! 'GENERAL))
(label (generate-label 'MOVE-LOOP))
;; Unroll an odd element if there is one; then do an even
(if (not overflow?)
(LAP (ASR X ,regnum:scratch-0 ,source1 (&U ,scheme-type-width))
(MUL X ,target ,regnum:scratch-0 ,source2))
- (let* ((mask (allocate-temporary-register! 'GENERAL))
- (hi (allocate-temporary-register! 'GENERAL)))
+ (let* ((mask regnum:scratch-0)
+ (hi regnum:scratch-1)
+ (temp (allocate-temporary-register! 'GENERAL)))
;; We're going to test whether the high 64-bits is equal to
;; the -1 or 0 we expect it to be. Overflow if not equal, no
;; overflow if equal.
(CSETM X LT ,mask)
(CMP X ,source2 (&U 0))
(CINV X LT ,mask ,mask)
- (ASR X ,regnum:scratch-0 ,source1 (&U ,scheme-type-width))
- (SMULH X ,hi ,regnum:scratch-0 ,source2)
- (MUL X ,target ,regnum:scratch-0 ,source2)
+ (ASR X ,temp ,source1 (&U ,scheme-type-width))
+ (SMULH X ,hi ,temp ,source2)
+ (MUL X ,target ,temp ,source2)
(CMP X ,mask ,hi))))))
(define-arithmetic-method 'FIXNUM-QUOTIENT fixnum-methods/2-args