[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 11/12: Add missing lsh/immediate, rsh/immediate type inf
From: |
Andy Wingo |
Subject: |
[Guile-commits] 11/12: Add missing lsh/immediate, rsh/immediate type inferrers |
Date: |
Sat, 11 Nov 2017 16:12:26 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 107f70a633efa33a7605623d3d02b2bafabbc0a2
Author: Andy Wingo <address@hidden>
Date: Sat Nov 11 21:44:45 2017 +0100
Add missing lsh/immediate, rsh/immediate type inferrers
* module/language/cps/types.scm (lsh/immediate, rsh/immediate): Add
missing type inferrers.
---
module/language/cps/types.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index a185eaa..1443841 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -1324,6 +1324,12 @@ minimum, and maximum."
(&min/0 count)
(&max/u64 count))))
(define-exact-integer! result min max)))
+(define-type-inferrer/param (lsh/immediate count val result)
+ (restrict! val &exact-integer -inf.0 +inf.0)
+ (let-values (((min max) (compute-ash-range (&min val)
+ (&max val)
+ count count)))
+ (define-exact-integer! result min max)))
(define-type-inferrer (rsh val count result)
(restrict! val &exact-integer -inf.0 +inf.0)
(let-values (((min max) (compute-ash-range (&min val)
@@ -1331,6 +1337,12 @@ minimum, and maximum."
(- (&min/0 count))
(- (&max/u64 count)))))
(define-exact-integer! result min max)))
+(define-type-inferrer/param (rsh/immediate count val result)
+ (restrict! val &exact-integer -inf.0 +inf.0)
+ (let-values (((min max) (compute-ash-range (&min val)
+ (&max val)
+ (- count) (- count))))
+ (define-exact-integer! result min max)))
(define-simple-type-checker (ursh &u64 &u64))
(define-type-inferrer (ursh a b result)
- [Guile-commits] branch master updated (f96a670 -> 83a03a3), Andy Wingo, 2017/11/11
- [Guile-commits] 01/12: Fix effects analysis bug introduced with primcall param, Andy Wingo, 2017/11/11
- [Guile-commits] 02/12: Refactor numeric comparison bytecode emission, Andy Wingo, 2017/11/11
- [Guile-commits] 05/12: Closure conversion uses immediate variants of vector instructions, Andy Wingo, 2017/11/11
- [Guile-commits] 06/12: Use immediate primcalls when unfolding constructors, Andy Wingo, 2017/11/11
- [Guile-commits] 09/12: Convert "ash" to "lsh"/"rsh" when lowering to CPS, Andy Wingo, 2017/11/11
- [Guile-commits] 12/12: Specialize rsh/lsh, not ash, Andy Wingo, 2017/11/11
- [Guile-commits] 07/12: Add tag-fixnum instruction, Andy Wingo, 2017/11/11
- [Guile-commits] 08/12: Compiler uses target fixnum range, Andy Wingo, 2017/11/11
- [Guile-commits] 03/12: Canonicalize <=, >=, and > primcalls to <, Andy Wingo, 2017/11/11
- [Guile-commits] 11/12: Add missing lsh/immediate, rsh/immediate type inferrers,
Andy Wingo <=
- [Guile-commits] 04/12: Specialize comparisons to SCM as s64, Andy Wingo, 2017/11/11
- [Guile-commits] 10/12: Type folding has "macro reduction" phase, Andy Wingo, 2017/11/11