[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 22/30: Fix inference of generic < on NaN values
From: |
Andy Wingo |
Subject: |
[Guile-commits] 22/30: Fix inference of generic < on NaN values |
Date: |
Fri, 24 Nov 2017 09:24:23 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit e79de9d4b569e708f34f98253b9bbaf2163b0ff0
Author: Andy Wingo <address@hidden>
Date: Wed Nov 22 10:44:34 2017 +0100
Fix inference of generic < on NaN values
* module/language/cps/types.scm (<): Don't infer anything if either
number could be a flonum.
---
module/language/cps/types.scm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index 852109f..20a648f 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -1051,16 +1051,18 @@ minimum, and maximum."
(restrict! b &bignum -inf.0 (1- (target-most-negative-fixnum)))))
(else
(infer-integer-< a b true?))))
- (else
+ ;; Can't include &flonum because of NaN. Perhaps we should model
+ ;; NaN with a separate type bit.
+ ((type<=? types &exact-number)
(let ((min0 (&min a)) (max0 (&max a))
(min1 (&min b)) (max1 (&max b)))
(cond
(true?
- (restrict! a &real min0 (min max0 max1))
- (restrict! b &real (max min0 min1) max1))
+ (restrict! a &exact-number min0 (min max0 max1))
+ (restrict! b &exact-number (max min0 min1) max1))
(else
- (restrict! a &real (max min0 min1) max0)
- (restrict! b &real min1 (min max0 max1)))))))))
+ (restrict! a &exact-number (max min0 min1) max0)
+ (restrict! b &exact-number min1 (min max0 max1)))))))))
(define-=-inferrer (u64-= &u64))
(define-predicate-inferrer (u64-< a b true?)
- [Guile-commits] 01/30: ursh, ursh/immediate, etc only residualized if count < 64, (continued)
- [Guile-commits] 01/30: ursh, ursh/immediate, etc only residualized if count < 64, Andy Wingo, 2017/11/24
- [Guile-commits] 05/30: Fix s64->scm reducer, Andy Wingo, 2017/11/24
- [Guile-commits] 02/30: Revert specialization of fixnum phi variables, Andy Wingo, 2017/11/24
- [Guile-commits] 09/30: Fix logand type inference, Andy Wingo, 2017/11/24
- [Guile-commits] 08/30: Revert "Slot allocation allows s64/u64 representations of same var", Andy Wingo, 2017/11/24
- [Guile-commits] 07/30: Fix u64/s64 typesafety around fixnum (un)tagging, Andy Wingo, 2017/11/24
- [Guile-commits] 14/30: Fix type check elision for branches, Andy Wingo, 2017/11/24
- [Guile-commits] 06/30: Separate u64 and s64 type inferrers now that ops are monomorphic, Andy Wingo, 2017/11/24
- [Guile-commits] 18/30: Remove thunk?, integer? simple predicate inferrers, Andy Wingo, 2017/11/24
- [Guile-commits] 17/30: Add support for bignum? CPS primitive., Andy Wingo, 2017/11/24
- [Guile-commits] 22/30: Fix inference of generic < on NaN values,
Andy Wingo <=
- [Guile-commits] 20/30: Add &exact-number helper definition, Andy Wingo, 2017/11/24
- [Guile-commits] 03/30: Better support for unboxed signed arithmetic, Andy Wingo, 2017/11/24
- [Guile-commits] 30/30: Optimize check-urange in assembler.scm, Andy Wingo, 2017/11/24
- [Guile-commits] 27/30: Add integer devirtualization pass., Andy Wingo, 2017/11/24
- [Guile-commits] 12/30: Remove effects-analysis exports that were undefined, Andy Wingo, 2017/11/24
- [Guile-commits] 11/30: Specialize fixnum and s64 phis, Andy Wingo, 2017/11/24
- [Guile-commits] 19/30: Add exact-integer? as interesting Tree-IL effect-free primitive, Andy Wingo, 2017/11/24
- [Guile-commits] 24/30: Declare bignum? as effect-free, Andy Wingo, 2017/11/24
- [Guile-commits] 13/30: Minor compile-cps refactor, Andy Wingo, 2017/11/24
- [Guile-commits] 15/30: DCE eliminates effect-free branches to the same continuation, Andy Wingo, 2017/11/24