Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/compiler/float-tran-dd.lisp
    ... ... @@ -290,10 +290,10 @@
    290 290
     	   (optimize (speed 3)))
    
    291 291
       ;; If the numbers are too big, scale them done so SPLIT doesn't overflow.
    
    292 292
       (multiple-value-bind (aa bb)
    
    293
    -      (values (if (> a +two970+)
    
    293
    +      (values (if (> (abs a) +two970+)
    
    294 294
     		  (* a +two-53+)
    
    295 295
     		  a)
    
    296
    -	      (if (> b +two970+)
    
    296
    +	      (if (> (abs b) +two970+)
    
    297 297
     		  (* b +two-53+)
    
    298 298
     		  b))
    
    299 299
         (let ((p (* aa bb)))
    
    ... ... @@ -314,10 +314,10 @@
    314 314
     		(declare (optimize (inhibit-warnings 3)))
    
    315 315
     	      ;; If the numbers was scaled down, we need to scale the
    
    316 316
     	      ;; result back up.
    
    317
    -	      (when (> a +two970+)
    
    317
    +	      (when (> (abs a) +two970+)
    
    318 318
     		(setf p (* p +two53+)
    
    319 319
     		      e (* e +two53+)))
    
    320
    -	      (when (> b +two970+)
    
    320
    +	      (when (> (abs b) +two970+)
    
    321 321
     		(setf p (* p +two53+)
    
    322 322
     		      e (* e +two53+)))
    
    323 323
     	      (values p e))))))))
    

  • tests/float.lisp
    ... ... @@ -342,3 +342,11 @@
    342 342
     			     (x86::x87-floating-point-modes)))))
    
    343 343
         (assert-true (typep new-mode 'x86::float-modes))
    
    344 344
         (assert-equal new-mode (setf (x86::x87-floating-point-modes) new-mode))))
    
    345
    +
    
    346
    +
    
    347
    +
    
    348
    +;; Issue #458
    
    349
    +(define-test dd-mult-overflow
    
    350
    +  (:tag :issues)
    
    351
    +  (assert-equal -2w300
    
    352
    +		(* -2w300 1w0)))