- (- sb!vm:n-word-bits shift1))))
- (if (>= m n)
- (flet ((word-mod (x)
- `(ldb (byte #.sb!vm:n-word-bits 0) ,x)))
- `(let* ((num x)
- (t1 (%multiply num ,(- m n))))
- (ash ,(word-mod `(+ t1 (ash ,(word-mod `(- num t1))
- -1)))
- ,(- 1 shift2))))
- `(ash (%multiply (ash x ,(- shift1)) ,m)
- ,(- shift2)))))))
+ (- precision shift1))))
+ (cond ((>= m n)
+ (flet ((word (x)
+ `(truly-the word ,x)))
+ `(let* ((num x)
+ (t1 (%multiply-high num ,(- m n))))
+ (ash ,(word `(+ t1 (ash ,(word `(- num t1))
+ -1)))
+ ,(- 1 shift2)))))
+ ((and (zerop shift1) (zerop shift2))
+ (let ((max (truncate max-x y)))
+ ;; Explicit TRULY-THE needed to get the FIXNUM=>FIXNUM
+ ;; VOP.
+ `(truly-the (integer 0 ,max)
+ (%multiply-high x ,m))))
+ (t
+ `(ash (%multiply-high (logandc2 x ,(1- (ash 1 shift1))) ,m)
+ ,(- (+ shift1 shift2)))))))))