- (when (numeric-type-p result-type)
- (let ((low (numeric-type-low result-type))
- (high (numeric-type-high result-type)))
- (when (and (numberp low)
- (numberp high)
- (>= low 0))
- (let ((width (integer-length high)))
- (multiple-value-bind (w kind signedp)
- (best-modular-version width nil)
- (when w
- ;; FIXME: This should be (CUT-TO-WIDTH NODE KIND WIDTH SIGNEDP).
- ;;
- ;; FIXME: I think the FIXME (which is from APD) above
- ;; implies that CUT-TO-WIDTH should do /everything/
- ;; that's required, including reoptimizing things
- ;; itself that it knows are necessary. At the moment,
- ;; CUT-TO-WIDTH sets up some new calls with
- ;; combination-type :FULL, which later get noticed as
- ;; known functions and properly converted.
- ;;
- ;; We cut to W not WIDTH if SIGNEDP is true, because
- ;; signed constant replacement needs to know which bit
- ;; in the field is the signed bit.
- (let ((xact (cut-to-width x kind (if signedp w width) signedp))
- (yact (cut-to-width y kind (if signedp w width) signedp)))
- (declare (ignore xact yact))
- nil) ; After fixing above, replace with T, meaning
- ; "don't reoptimize this (LOGAND) node any more".
- ))))))))
+ (multiple-value-bind (low high)
+ (integer-type-numeric-bounds result-type)
+ (when (and (numberp low)
+ (numberp high)
+ (>= low 0))
+ (let ((width (integer-length high)))
+ (multiple-value-bind (w kind signedp)
+ (best-modular-version width nil)
+ (when w
+ ;; FIXME: This should be (CUT-TO-WIDTH NODE KIND WIDTH SIGNEDP).
+ ;;
+ ;; FIXME: I think the FIXME (which is from APD) above
+ ;; implies that CUT-TO-WIDTH should do /everything/
+ ;; that's required, including reoptimizing things
+ ;; itself that it knows are necessary. At the moment,
+ ;; CUT-TO-WIDTH sets up some new calls with
+ ;; combination-type :FULL, which later get noticed as
+ ;; known functions and properly converted.
+ ;;
+ ;; We cut to W not WIDTH if SIGNEDP is true, because
+ ;; signed constant replacement needs to know which bit
+ ;; in the field is the signed bit.
+ (let ((xact (cut-to-width x kind (if signedp w width) signedp))
+ (yact (cut-to-width y kind (if signedp w width) signedp)))
+ (declare (ignore xact yact))
+ nil) ; After fixing above, replace with T, meaning
+ ; "don't reoptimize this (LOGAND) node any more".
+ )))))))