Changeset 16149


Ignore:
Timestamp:
Jul 28, 2014, 5:11:25 PM (7 years ago)
Author:
gb
Message:

Try harder in BOUNDED-INTEGER-TYPE-FOR-MULTIPLICATION. Fixes ticket:1211 .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/nx0.lisp

    r16111 r16149  
    607607         (t2 (if t1 (bounded-integer-type-p type2))))
    608608    (when t2
    609       (specifier-type `(integer
    610                         ,(* (numeric-ctype-low t1) (numeric-ctype-low t2))
    611                         ,(* (numeric-ctype-high t1) (numeric-ctype-high t2)))))))
     609      (and (csubtypep t1 (specifier-type '(signed-byte 64)))
     610           (csubtypep t2 (specifier-type '(signed-byte 64)))
     611           (let* ((t1low (numeric-ctype-low t1))
     612                  (t1high (numeric-ctype-high t1))
     613                  (t2low (numeric-ctype-low t2))
     614                  (t2high (numeric-ctype-high t2))
     615                  (p0 (* t1low t2low))
     616                  (p1 (* t1low t2high))
     617                  (p2 (* t1high t2low))
     618                  (p3 (* t1high t2high))
     619                  (min (min p0 p1 p2 p3))
     620                  (max (max p0 p1 p2 p3)))
     621             (specifier-type `(integer
     622                               ,min
     623                               ,max)))))))
    612624
    613625(defun bounded-integer-type-for-ash (type1 type2)
Note: See TracChangeset for help on using the changeset viewer.