[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/08: Simplify special immediate predicate inferrer.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/08: Simplify special immediate predicate inferrer. |
Date: |
Mon, 30 Oct 2017 07:35:34 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 9ceab9962af514a2b56d432352a6a7ae0c685497
Author: Andy Wingo <address@hidden>
Date: Mon Oct 30 11:18:54 2017 +0100
Simplify special immediate predicate inferrer.
* module/language/cps/types.scm
(define-special-immediate-predicate-inferrer): Simplify.
---
module/language/cps/types.scm | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index f19adde..6ea7ced 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -543,18 +543,17 @@ minimum, and maximum."
;;; Generic effect-free predicates.
;;;
-(define-syntax-rule (define-special-immediate-predicate-inferrer pred imm*)
+(define-syntax-rule (define-special-immediate-predicate-inferrer pred imm)
(define-predicate-inferrer (pred val true?)
- (let ((imm imm*))
- (define (range-subtract lo hi x)
- (values (if (eqv? lo x) (1+ lo) lo)
- (if (eqv? hi x) (1- hi) hi)))
- (cond
- (true? (restrict! val &special-immediate imm imm))
- (else
- (when (eqv? (&type val) &special-immediate)
- (let-values (((lo hi) (range-subtract (&min val) (&max val) imm)))
- (restrict! val &special-immediate lo hi))))))))
+ (define (range-subtract lo hi x)
+ (values (if (eqv? lo x) (1+ lo) lo)
+ (if (eqv? hi x) (1- hi) hi)))
+ (cond
+ (true? (restrict! val &special-immediate imm imm))
+ (else
+ (when (eqv? (&type val) &special-immediate)
+ (let-values (((lo hi) (range-subtract (&min val) (&max val) imm)))
+ (restrict! val &special-immediate lo hi)))))))
(define-special-immediate-predicate-inferrer eq-nil? &nil)
(define-special-immediate-predicate-inferrer eq-eol? &null)
- [Guile-commits] branch master updated (d1c69b5 -> 4267a8b), Andy Wingo, 2017/10/30
- [Guile-commits] 03/08: Fix argument type of arguments<=? instruction, Andy Wingo, 2017/10/30
- [Guile-commits] 02/08: Remove assembler exports for old-style predicates and branches, Andy Wingo, 2017/10/30
- [Guile-commits] 07/08: RTL test uses new instructions, Andy Wingo, 2017/10/30
- [Guile-commits] 04/08: Emit new instructions in function preludes, Andy Wingo, 2017/10/30
- [Guile-commits] 06/08: Simplify special immediate predicate inferrer.,
Andy Wingo <=
- [Guile-commits] 01/08: Lower logtest branches to instead be 'zero? logand', Andy Wingo, 2017/10/30
- [Guile-commits] 05/08: Remove disassembler support for old-style jump instructions, Andy Wingo, 2017/10/30
- [Guile-commits] 08/08: Remove old branching instructions from VM, Andy Wingo, 2017/10/30