[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/30: Separate u64 and s64 type inferrers now that ops
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/30: Separate u64 and s64 type inferrers now that ops are monomorphic |
Date: |
Fri, 24 Nov 2017 09:24:20 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 072188618a36a1dd1a1e3bd59e0e7e1e4d65da67
Author: Andy Wingo <address@hidden>
Date: Mon Nov 20 17:57:34 2017 +0100
Separate u64 and s64 type inferrers now that ops are monomorphic
* module/language/cps/types.scm: Remove some more needless type checker
definitions.
(u64-imm-=, u64-imm-<, imm-u64-<): Separate from the s64 definitions.
(s64-imm-=, s64-imm-<, imm-s64-<): New definitions.
---
module/language/cps/types.scm | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index 8ff7556..c9cb078 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -778,7 +778,6 @@ minimum, and maximum."
(restrict! v &vector (1+ (&min/0 idx)) (target-max-vector-length))
(restrict! idx &u64 0 (1- (&max/vector v))))
-(define-simple-type-checker (make-vector/immediate &all-types))
(define-type-inferrer/param (make-vector/immediate size init result)
(define! result &vector size size))
@@ -1037,22 +1036,27 @@ minimum, and maximum."
(define-predicate-inferrer/param (u64-imm-= b a true?)
(when true?
- (restrict! a (logior &u64 &s64) (max (&min a) b) (min (&max a) b))))
-
+ (restrict! a &u64 (max (&min a) b) (min (&max a) b))))
(define-predicate-inferrer/param (u64-imm-< b a true?)
(if true?
- (restrict! a (logior &u64 &s64) (&min a) (min (&max a) (1- b)))
- (restrict! a (logior &u64 &s64) (max (&min a) b) (&max a))))
-
+ (restrict! a &u64 (&min a) (min (&max a) (1- b)))
+ (restrict! a &u64 (max (&min a) b) (&max a))))
(define-predicate-inferrer/param (imm-u64-< b a true?)
(if true?
- (restrict! a (logior &u64 &s64) (max (1+ (&min a)) b) (&max a))
- (restrict! a (logior &u64 &s64) (&min a) (min (&max a) b))))
-
-(define-type-aliases u64-imm-= s64-imm-=)
-(define-type-aliases u64-imm-< s64-imm-<)
-(define-type-aliases imm-u64-< imm-s64-<)
+ (restrict! a &u64 (max (1+ (&min a)) b) (&max a))
+ (restrict! a &u64 (&min a) (min (&max a) b))))
+(define-predicate-inferrer/param (s64-imm-= b a true?)
+ (when true?
+ (restrict! a &s64 (max (&min a) b) (min (&max a) b))))
+(define-predicate-inferrer/param (s64-imm-< b a true?)
+ (if true?
+ (restrict! a &s64 (&min a) (min (&max a) (1- b)))
+ (restrict! a &s64 (max (&min a) b) (&max a))))
+(define-predicate-inferrer/param (imm-s64-< b a true?)
+ (if true?
+ (restrict! a &s64 (max (1+ (&min a)) b) (&max a))
+ (restrict! a &s64 (&min a) (min (&max a) b))))
;; Unfortunately, we can't define f64 comparison inferrers because of
@@ -1498,7 +1502,6 @@ minimum, and maximum."
(logand-min (&min a) (&min b))
(logand-max (&max a) (&max b))))
-(define-simple-type-checker (ulogand &u64 &u64))
(define-type-inferrer (ulogand a b result)
(restrict! a &u64 0 &u64-max)
(restrict! b &u64 0 &u64-max)
@@ -1529,7 +1532,6 @@ minimum, and maximum."
(lambda (min max)
(define-exact-integer! result min max))))
-(define-simple-type-checker (ulogsub &u64 &u64))
(define-type-inferrer (ulogsub a b result)
(restrict! a &u64 0 &u64-max)
(restrict! b &u64 0 &u64-max)
@@ -1556,7 +1558,6 @@ minimum, and maximum."
(logior-min (&min a) (&min b))
(logior-max (&max a) (&max b))))
-(define-simple-type-checker (ulogior &u64 &u64))
(define-type-inferrer (ulogior a b result)
(restrict! a &u64 0 &u64-max)
(restrict! b &u64 0 &u64-max)
@@ -1567,7 +1568,6 @@ minimum, and maximum."
;; For our purposes, treat logxor the same as logior.
(define-type-aliases logior logxor)
-(define-simple-type-checker (ulogxor &u64 &u64))
(define-type-inferrer (ulogxor a b result)
(restrict! a &u64 0 &u64-max)
(restrict! b &u64 0 &u64-max)
@@ -1640,7 +1640,6 @@ minimum, and maximum."
(restrict! i &u64 0 *max-codepoint*)
(define! result &char (&min/0 i) (min (&max i) *max-codepoint*)))
-(define-simple-type-checker (char->integer &char))
(define-type-inferrer (char->integer c result)
(restrict! c &char 0 *max-codepoint*)
(define! result &u64 (&min/0 c) (min (&max c) *max-codepoint*)))
- [Guile-commits] branch master updated (0951551 -> 7d71d9b), Andy Wingo, 2017/11/24
- [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 <=
- [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, 2017/11/24
- [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