- ;; Multiply the two numbers and put the result in
- ;; result-high. Copy the low 32-bits to result-low. Then
- ;; shift result-high so the high 32-bits end up in the low
- ;; 32-bits.
- (inst mulx result-high multiplier multiplicand)
- (inst move result-low result-high)
- (inst srax result-high 32))
- #!+(and (not :sparc-64) (or :sparc-v8 :sparc-v9))
- (progn
- ;; V8 has a multiply instruction. This should also work for
- ;; the V9, but umul and the Y register is deprecated on the
- ;; V9.
- (inst umul result-low multiplier multiplicand)
- (inst rdy result-high))
- #!+(and (not :sparc-64) (not (or :sparc-v8 :sparc-v9)))
- (let ((label (gen-label)))
- (inst wry multiplier)
- (inst andcc result-high zero-tn)
- ;; Note: we can't use the Y register until three insts
- ;; after it's written.
- (inst nop)
- (inst nop)
- (dotimes (i 32)
- (inst mulscc result-high multiplicand))
- (inst mulscc result-high zero-tn)
- (inst cmp multiplicand)
- (inst b :ge label)
- (inst nop)
- (inst add result-high multiplier)
- (emit-label label)
- (inst rdy result-low)))
+ ;; Multiply the two numbers and put the result in
+ ;; result-high. Copy the low 32-bits to result-low. Then
+ ;; shift result-high so the high 32-bits end up in the low
+ ;; 32-bits.
+ (inst mulx result-high multiplier multiplicand)
+ (inst move result-low result-high)
+ (inst srax result-high 32))
+ ((or (member :sparc-v8 *backend-subfeatures*)
+ (member :sparc-v9 *backend-subfeatures*))
+ ;; V8 has a multiply instruction. This should also work for
+ ;; the V9, but umul and the Y register is deprecated on the
+ ;; V9.
+ (inst umul result-low multiplier multiplicand)
+ (inst rdy result-high))
+ (t
+ (let ((label (gen-label)))
+ (inst wry multiplier)
+ (inst andcc result-high zero-tn)
+ ;; Note: we can't use the Y register until three insts
+ ;; after it's written.
+ (inst nop)
+ (inst nop)
+ (dotimes (i 32)
+ (inst mulscc result-high multiplicand))
+ (inst mulscc result-high zero-tn)
+ (inst cmp multiplicand)
+ (inst b :ge label)
+ (inst nop)
+ (inst add result-high multiplier)
+ (emit-label label)
+ (inst rdy result-low)))))