mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
Better type folding for = on exact numbers
* module/language/cps/type-fold.scm (=): Fold to #f if values are exact but of different types. (s64-=): Add missing alias.
This commit is contained in:
parent
cdd51d0995
commit
695362a830
1 changed files with 11 additions and 4 deletions
|
@ -178,11 +178,18 @@
|
|||
(define-branch-folder-alias imm-s64-< imm-u64-<)
|
||||
|
||||
(define-binary-branch-folder (= type0 min0 max0 type1 min1 max1)
|
||||
(if (and (type<=? (logior type0 type1)
|
||||
(logior &exact-integer &fraction))
|
||||
(zero? (logand type0 type1)))
|
||||
;; If both values are exact but of different types, they are not
|
||||
;; equal.
|
||||
(values #t #f)
|
||||
(case (compare-integer-ranges type0 min0 max0 type1 min1 max1)
|
||||
((=) (values #t #t))
|
||||
((< >) (values #t #f))
|
||||
(else (values #f #f))))
|
||||
(else (values #f #f)))))
|
||||
(define-branch-folder-alias u64-= =)
|
||||
(define-branch-folder-alias s64-= =)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue