summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2024-09-23 15:32:45 +0200
committerAndy Wingo <wingo@pobox.com>2024-09-23 15:32:45 +0200
commitd6af34c0e085d785e89a64089de9779282874a2f (patch)
tree23bda67ddeb3d37088af09cdd4daa7f9767a2075
parent90e1205018f13c86355517c85db8cf82952c6e98 (diff)
downloadguile-d6af34c0e085d785e89a64089de9779282874a2f.tar.gz
Remove needless constraints in type/range analysis
* module/language/cps/types.scm (ulogand, ulogand/immediate, ulogsub, ulogior, ulogxor): Where we have u64 inputs, there's no need to `restrict!`; the range will come from the definition.
-rw-r--r--module/language/cps/types.scm11
1 files changed, 1 insertions, 10 deletions
diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index abfca4794..512be4bb2 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -1,5 +1,5 @@
;;; Type analysis on CPS
-;;; Copyright (C) 2014-2021, 2023 Free Software Foundation, Inc.
+;;; Copyright (C) 2014-2021,2023-2024 Free Software Foundation, Inc.
;;;
;;; This library is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU Lesser General Public License as
@@ -1653,11 +1653,8 @@ where (A0 <= A <= A1) and (B0 <= B <= B1)."
(define-exact-integer! result min max))))
(define-type-inferrer (ulogand a b result)
- (restrict! a &u64 0 &u64-max)
- (restrict! b &u64 0 &u64-max)
(define! result &u64 0 (min (&max/u64 a) (&max/u64 b))))
(define-type-inferrer/param (ulogand/immediate param a result)
- (restrict! a &u64 0 &u64-max)
(call-with-values (lambda ()
(logand-bounds (&min a) (&max a) param param))
(lambda (min max)
@@ -1682,8 +1679,6 @@ i.e. (logand A (lognot B)), where (A0 <= A <= A1) and (B0 <= B <= B1)."
(define-exact-integer! result min max))))
(define-type-inferrer (ulogsub a b result)
- (restrict! a &u64 0 &u64-max)
- (restrict! b &u64 0 &u64-max)
(define! result &u64 0 (&max/u64 a)))
(define (logior-bounds a0 a1 b0 b1)
@@ -1729,8 +1724,6 @@ where (A0 <= A <= A1) and (B0 <= B <= B1)."
(define-exact-integer! result min max))))
(define-type-inferrer (ulogior a b result)
- (restrict! a &u64 0 &u64-max)
- (restrict! b &u64 0 &u64-max)
(define! result &u64
(max (&min/0 a) (&min/0 b))
(saturate+ (&max/u64 a) (&max/u64 b))))
@@ -1786,8 +1779,6 @@ where (A0 <= A <= A1) and (B0 <= B <= B1)."
(define! result &exact-integer min max))))
(define-type-inferrer (ulogxor a b result)
- (restrict! a &u64 0 &u64-max)
- (restrict! b &u64 0 &u64-max)
(define! result &u64 0 (saturate+ (&max/u64 a) (&max/u64 b))))
(define-simple-type-checker (lognot &exact-integer))