1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

Remove compiler support for u64-scm comparisons

* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/effects-analysis.scm:
* module/language/cps/primitives.scm (*comparisons*):
* module/language/cps/type-fold.scm:
* module/language/cps/types.scm: Remove compiler support for u64-scm
  comparisons, as this is now inlined.
This commit is contained in:
Andy Wingo 2017-10-29 21:02:56 +01:00
parent 6bb0a96fa1
commit d1c69b5c95
5 changed files with 0 additions and 48 deletions

View file

@ -471,11 +471,6 @@
(($ $primcall 'f64-= (a b)) (binary-test emit-f64=? a b))
(($ $primcall 'f64->= (a b)) (binary* emit-f64<? emit-jge emit-jnge a b))
(($ $primcall 'f64-> (a b)) (binary* emit-f64<? emit-jl emit-jnl b a))
(($ $primcall 'u64-<-scm (a b)) (binary emit-br-if-u64-<-scm a b))
(($ $primcall 'u64-<=-scm (a b)) (binary emit-br-if-u64-<=-scm a b))
(($ $primcall 'u64-=-scm (a b)) (binary emit-br-if-u64-=-scm a b))
(($ $primcall 'u64->=-scm (a b)) (binary emit-br-if-u64->=-scm a b))
(($ $primcall 'u64->-scm (a b)) (binary emit-br-if-u64->-scm a b))
(($ $primcall 'logtest (a b)) (binary emit-br-if-logtest a b))))
(define (compile-trunc label k exp nreq rest-var)

View file

@ -447,11 +447,6 @@ is or might be a read or a write to the same location as A."
((u64-> . _))
((u64-<= . _))
((u64->= . _))
((u64-<-scm . _) &type-check)
((u64-<=-scm . _) &type-check)
((u64-=-scm . _) &type-check)
((u64->=-scm . _) &type-check)
((u64->-scm . _) &type-check)
((s64-= . _))
((s64-< . _))
((s64-> . _))

View file

@ -145,9 +145,6 @@ before it is lowered to CPS?"
;; FIXME: Expand these.
logtest
u64-<-scm
u64-<=-scm
u64-=-scm
;; FIXME: Remove these.
>
@ -156,8 +153,6 @@ before it is lowered to CPS?"
u64->=
s64->
s64->=
u64->=-scm
u64->-scm
f64->
f64->=))

View file

@ -146,7 +146,6 @@
(else (values #f #f))))
(define-branch-folder-alias u64-< <)
(define-branch-folder-alias s64-< <)
(define-branch-folder-alias u64-<-scm <)
;; We currently cannot define branch folders for floating point
;; comparison ops like the commented one below because we can't prove
;; there are no nans involved.
@ -160,7 +159,6 @@
(else (values #f #f))))
(define-branch-folder-alias u64-<= <=)
(define-branch-folder-alias s64-<= <=)
(define-branch-folder-alias u64-<=-scm <=)
(define-binary-branch-folder (= type0 min0 max0 type1 min1 max1)
(case (compare-ranges type0 min0 max0 type1 min1 max1)
@ -169,7 +167,6 @@
(else (values #f #f))))
(define-branch-folder-alias u64-= =)
(define-branch-folder-alias s64-= =)
(define-branch-folder-alias u64-=-scm =)
(define-binary-branch-folder (>= type0 min0 max0 type1 min1 max1)
(case (compare-ranges type0 min0 max0 type1 min1 max1)
@ -178,7 +175,6 @@
(else (values #f #f))))
(define-branch-folder-alias u64->= >=)
(define-branch-folder-alias s64->= >=)
(define-branch-folder-alias u64->=-scm >=)
(define-binary-branch-folder (> type0 min0 max0 type1 min1 max1)
(case (compare-ranges type0 min0 max0 type1 min1 max1)
@ -187,7 +183,6 @@
(else (values #f #f))))
(define-branch-folder-alias u64-> >)
(define-branch-folder-alias s64-> >)
(define-branch-folder-alias u64->-scm >)
(define-binary-branch-folder (logtest type0 min0 max0 type1 min1 max1)
(define (logand-min a b)

View file

@ -991,34 +991,6 @@ minimum, and maximum."
(restrict! a &u64 min max)
(restrict! b &u64 min max))))
(define-simple-type-checker (u64-=-scm &u64 &real))
(define-predicate-inferrer (u64-=-scm a b true?)
(when (and true? (zero? (logand (&type b) (lognot &real))))
(let ((min (max (&min/0 a) (&min/0 b)))
(max (min (&max/u64 a) (&max/u64 b))))
(restrict! a &u64 min max)
(restrict! b &real min max))))
(define-simple-type-checker (u64-<-scm &u64 &real))
(define-predicate-inferrer (u64-<-scm a b true?)
(when (and true? (zero? (logand (&type b) (lognot &real))))
(true-comparison-restrictions '< a b &u64 &real)))
(define-simple-type-checker (u64-<=-scm &u64 &real))
(define-predicate-inferrer (u64-<=-scm a b true?)
(when (and true? (zero? (logand (&type b) (lognot &real))))
(true-comparison-restrictions '<= a b &u64 &real)))
(define-simple-type-checker (u64->=-scm &u64 &real))
(define-predicate-inferrer (u64->=-scm a b true?)
(when (and true? (zero? (logand (&type b) (lognot &real))))
(true-comparison-restrictions '>= a b &u64 &real)))
(define-simple-type-checker (u64->-scm &u64 &real))
(define-predicate-inferrer (u64->-scm a b true?)
(when (and true? (zero? (logand (&type b) (lognot &real))))
(true-comparison-restrictions '> a b &u64 &real)))
(define (infer-u64-comparison-ranges op min0 max0 min1 max1)
(match op
('< (values min0 (min max0 (1- max1)) (max (1+ min0) min1) max1))