[Guile-commits] branch master updated (7d71d9b -> 16ed2ae)

2017-11-28 Thread Andy Wingo
wingo pushed a change to branch master
in repository guile.

  from  7d71d9b   Optimize check-urange in assembler.scm
   new  bc1fdf7   Refactor aux definition fabrication in CSE pass
   new  aeb7c18   Add fabricated expressions for u64-s64 conversion
   new  abd5d2e   Fix arity of slsh/immediate inferrer
   new  96d1cff   Tighten up untag-fixnum range
   new  16ed2ae   Enable lsh/immediate, rsh/immediate specialization

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 module/language/cps/cse.scm| 135 -
 module/language/cps/specialize-numbers.scm |  12 +--
 module/language/cps/types.scm  |   4 +-
 3 files changed, 62 insertions(+), 89 deletions(-)



[Guile-commits] 04/05: Tighten up untag-fixnum range

2017-11-28 Thread Andy Wingo
wingo pushed a commit to branch master
in repository guile.

commit 96d1cff8027b4a20041da9d73cbdb9a22de47428
Author: Andy Wingo 
Date:   Tue Nov 28 22:21:40 2017 +0100

Tighten up untag-fixnum range

* module/language/cps/types.scm (untag-fixnum): Tighten up range.
---
 module/language/cps/types.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index 4ccdb85..dd2206b 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -952,7 +952,7 @@ minimum, and maximum."
   (define! result  param param))
 
 (define-type-inferrer (untag-fixnum scm result)
-  (define! result  (/s64 scm) (/s64 scm)))
+  (define! result  (/fixnum scm) (/fixnum scm)))
 
 (define-type-inferrer (tag-fixnum s64 result)
   (define! result  (/fixnum s64) (/fixnum s64)))



[Guile-commits] 02/05: Add fabricated expressions for u64-s64 conversion

2017-11-28 Thread Andy Wingo
wingo pushed a commit to branch master
in repository guile.

commit aeb7c18b9944f1a13bc987ab514341b390567f1c
Author: Andy Wingo 
Date:   Mon Nov 27 16:51:31 2017 +0100

Add fabricated expressions for u64-s64 conversion

* module/language/cps/cse.scm (compute-equivalent-subexpressions): Add
  cases for u64->s64 and s64->u64.
---
 module/language/cps/cse.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/module/language/cps/cse.scm b/module/language/cps/cse.scm
index 512c3a2..bb19597 100644
--- a/module/language/cps/cse.scm
+++ b/module/language/cps/cse.scm
@@ -312,7 +312,9 @@ false.  It could be that both true and false proofs are 
available."
;; NB: These definitions rely on U having top 2 bits equal to
;; 3rd (sign) bit.
((s <- tag-fixnum #f u)   (u <- scm->s64 #f s)
- (u <- untag-fixnum #f s)
+ (u <- untag-fixnum #f s))
+   ((s <- u64->s64 #f u) (u <- s64->u64 #f s))
+   ((u <- s64->u64 #f s) (s <- u64->s64 #f u)
 
   (define (visit-label label equiv-labels var-substs)
 (match (intmap-ref conts label)



[Guile-commits] 01/05: Refactor aux definition fabrication in CSE pass

2017-11-28 Thread Andy Wingo
wingo pushed a commit to branch master
in repository guile.

commit bc1fdf73dba30bb3b4d5884e8d721b8a2bb0c506
Author: Andy Wingo 
Date:   Mon Nov 27 16:18:40 2017 +0100

Refactor aux definition fabrication in CSE pass

* module/language/cps/cse.scm (compute-equivalent-subexpressions):
  Define a little language for creating aux definitions.
---
 module/language/cps/cse.scm | 133 +---
 1 file changed, 52 insertions(+), 81 deletions(-)

diff --git a/module/language/cps/cse.scm b/module/language/cps/cse.scm
index 9d38c3a..512c3a2 100644
--- a/module/language/cps/cse.scm
+++ b/module/language/cps/cse.scm
@@ -257,91 +257,62 @@ false.  It could be that both true and false proofs are 
available."
   (($ $prompt escape? tag handler) #f)))
 
   (define (add-auxiliary-definitions! label var-substs exp-key)
-(define (subst var)
-  (subst-var var-substs var))
-(let ((defs (intmap-ref defs label)))
+(let ((defs (and=> (intmap-ref defs label)
+   (lambda (defs) (subst-vars var-substs defs)
   (define (add-def! aux-key var)
 (let ((equiv (hash-ref equiv-set aux-key '(
   (hash-set! equiv-set aux-key
  (acons label (list var) equiv
-  (match exp-key
-(('primcall 'box #f val)
- (match defs
-   ((box)
-(add-def! `(primcall box-ref #f ,(subst box)) val
-(('primcall 'box-set! #f box val)
- (add-def! `(primcall box-ref #f ,box) val))
-(('primcall 'cons #f car cdr)
- (match defs
-   ((pair)
-(add-def! `(primcall car #f ,(subst pair)) car)
-(add-def! `(primcall cdr #f ,(subst pair)) cdr
-(('primcall 'set-car! #f pair car)
- (add-def! `(primcall car #f ,pair) car))
-(('primcall 'set-cdr! #f pair cdr)
- (add-def! `(primcall cdr #f ,pair) cdr))
-;; FIXME: how to propagate make-vector/immediate -> vector-length?
-(('primcall 'make-vector #f len fill)
- (match defs
-   ((vec)
-(add-def! `(primcall vector-length #f ,(subst vec)) len
-(('primcall 'vector-set! #f vec idx val)
- (add-def! `(primcall vector-ref #f ,vec ,idx) val))
-(('primcall 'vector-set!/immediate idx vec val)
- (add-def! `(primcall vector-ref/immediate ,idx ,vec) val))
-(('primcall 'allocate-struct #f vtable size)
- (match defs
-   ((struct)
-(add-def! `(primcall struct-vtable #f ,(subst struct))
-  vtable
-(('primcall 'allocate-struct/immediate size vtable)
- (match defs
-   ((struct)
-(add-def! `(primcall struct-vtable #f ,(subst struct))
-  vtable
-;; FIXME: Aren't we missing some "subst" calls here?
-(('primcall 'struct-set! #f struct n val)
- (add-def! `(primcall struct-ref #f ,struct ,n) val))
-(('primcall 'struct-set!/immediate n struct val)
- (add-def! `(primcall struct-ref/immediate ,n ,struct) val))
-(('primcall 'scm->f64 #f scm)
- (match defs
-   ((f64)
-(add-def! `(primcall f64->scm #f ,f64) scm
-(('primcall 'f64->scm #f f64)
- (match defs
-   ((scm)
-(add-def! `(primcall scm->f64 #f ,scm) f64
-(('primcall 'scm->u64 #f scm)
- (match defs
-   ((u64)
-(add-def! `(primcall u64->scm #f ,u64) scm
-(('primcall (or 'u64->scm 'u64->scm/unlikely) #f u64)
- (match defs
-   ((scm)
-(add-def! `(primcall scm->u64 #f ,scm) u64)
-(add-def! `(primcall scm->u64/truncate #f ,scm) u64
-(('primcall 'scm->s64 #f scm)
- (match defs
-   ((s64)
-(add-def! `(primcall s64->scm #f ,s64) scm
-(('primcall (or 's64->scm 's64->scm/unlikely) #f s64)
- (match defs
-   ((scm)
-(add-def! `(primcall scm->s64 #f ,scm) s64
-(('primcall 'untag-fixnum #f scm)
- (match defs
-   ((s64)
-(add-def! `(primcall s64->scm #f ,s64) scm)
-(add-def! `(primcall tag-fixnum #f ,s64) scm
-(('primcall 'tag-fixnum #f fx)
- (match defs
-   ((scm)
-;; NB: These definitions rely on FX having top 2 bits
-;; equal to 3rd (sign) bit.
-(add-def! `(primcall scm->s64 #f ,scm) fx)
-(add-def! `(primcall untag-fixnum #f ,scm) fx
-(_ #t
+  

[Guile-commits] 05/05: Enable lsh/immediate, rsh/immediate specialization

2017-11-28 Thread Andy Wingo
wingo pushed a commit to branch master
in repository guile.

commit 16ed2aee88f017c8223aef38bbf9606bd817dc35
Author: Andy Wingo 
Date:   Mon Nov 27 15:03:23 2017 +0100

Enable lsh/immediate, rsh/immediate specialization

* module/language/cps/specialize-numbers.scm (specialize-operations):
  Fix typo in match syntax preventing us from optimizing the immediate
  variants of lsh and rsh, and typo also in specialize-unop argument
  order.
---
 module/language/cps/specialize-numbers.scm | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/module/language/cps/specialize-numbers.scm 
b/module/language/cps/specialize-numbers.scm
index a0c4b15..7df5f2a 100644
--- a/module/language/cps/specialize-numbers.scm
+++ b/module/language/cps/specialize-numbers.scm
@@ -534,7 +534,7 @@ BITS indicating the significant bits needed for a variable. 
 BITS may be
   (setk label ($kargs names vars ,body)
 
  (((or 'add/immediate 'sub/immediate 'mul/immediate)
-   (? u64-result?) (? u64-parameter? b) (? u64-operand? a))
+   (? u64-result?) (? u64-parameter?) (? u64-operand? a))
   (let ((op (match op
   ('add/immediate 'uadd/immediate)
   ('sub/immediate 'usub/immediate)
@@ -546,7 +546,7 @@ BITS indicating the significant bits needed for a variable. 
 BITS may be
   (setk label ($kargs names vars ,body)
 
  (((or 'add/immediate 'sub/immediate 'mul/immediate)
-   (? s64-result?) (? s64-parameter? b) (? s64-operand? a))
+   (? s64-result?) (? s64-parameter?) (? s64-operand? a))
   (let ((op (match op
   ('add/immediate 'sadd/immediate)
   ('sub/immediate 'ssub/immediate)
@@ -582,24 +582,24 @@ BITS indicating the significant bits needed for a 
variable.  BITS may be
   (setk label ($kargs names vars ,body)
 
  (((or 'lsh/immediate 'rsh/immediate)
-   (? u64-result?) (? u6-parameter? b) (u64-operand? a))
+   (? u64-result?) (? u6-parameter?) (? u64-operand? a))
   (let ((op (match op
   ('lsh/immediate 'ulsh/immediate)
   ('rsh/immediate 'ursh/immediate
 (with-cps cps
   (let$ body (specialize-unop
-  k src op a param
+  k src op param a
   (unbox-u64 a) (box-u64 result)))
   (setk label ($kargs names vars ,body)
 
  (((or 'lsh/immediate 'rsh/immediate)
-   (? s64-result?) (? u6-parameter? b) (s64-operand? a))
+   (? s64-result?) (? u6-parameter?) (? s64-operand? a))
   (let ((op (match op
   ('lsh/immediate 'slsh/immediate)
   ('rsh/immediate 'srsh/immediate
 (with-cps cps
   (let$ body (specialize-unop
-  k src op a param
+  k src op param a
   (unbox-s64 a) (box-s64 result)))
   (setk label ($kargs names vars ,body)
 



[Guile-commits] 03/05: Fix arity of slsh/immediate inferrer

2017-11-28 Thread Andy Wingo
wingo pushed a commit to branch master
in repository guile.

commit abd5d2e428cfdb5ad21f127e2b9c34f706d46acd
Author: Andy Wingo 
Date:   Tue Nov 28 22:28:40 2017 +0100

Fix arity of slsh/immediate inferrer

* module/language/cps/types.scm (slsh/immediate): Fix arity.
---
 module/language/cps/types.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index d3a6b20..4ccdb85 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -1520,7 +1520,7 @@ minimum, and maximum."
 (if (<=  min max )
 (define! result  min max)
 (define! result   
-(define-type-inferrer (slsh/immediate param a result)
+(define-type-inferrer/param (slsh/immediate param a result)
   (let-values (((min max) (compute-ash-range ( a) ( a)
  param param)))
 (if (<=  min max )



[Guile-commits] Failed with output: Hydra job gnu:guile-master:coverage on x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:coverage’ (on x86_64-linux) has 
changed from "Dependency failed" to "Failed with output".  For details, see

  https://hydra.nixos.org/build/63802709

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_clang.i686-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build_clang.i686-linux’ has changed 
from "Dependency failed" to "Failed with output".  For details, see

  https://hydra.nixos.org/build/63802704

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build.x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build.x86_64-linux’ has changed from 
"Dependency failed" to "Failed with output".  For details, see

  https://hydra.nixos.org/build/63802707

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_enable_guile_debug on x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build_enable_guile_debug’ (on 
x86_64-linux) has changed from "Dependency failed" to "Failed with output".  
For details, see

  https://hydra.nixos.org/build/63802695

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_without_threads.x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build_without_threads.x86_64-linux’ 
has changed from "Dependency failed" to "Failed with output".  For details, see

  https://hydra.nixos.org/build/63802708

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_CPPFLAGS=_DSCM_DEBUG=1 on x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build_CPPFLAGS=_DSCM_DEBUG=1’ (on 
x86_64-linux) has changed from "Dependency failed" to "Failed with output".  
For details, see

  https://hydra.nixos.org/build/63802711

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build.i686-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build.i686-linux’ has changed from 
"Dependency failed" to "Failed with output".  For details, see

  https://hydra.nixos.org/build/63802700

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_clang.x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build_clang.x86_64-linux’ has changed 
from "Dependency failed" to "Failed with output".  For details, see

  https://hydra.nixos.org/build/63802698

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_disable_deprecated_disable_discouraged on x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job 
‘gnu:guile-master:build_disable_deprecated_disable_discouraged’ (on 
x86_64-linux) has changed from "Dependency failed" to "Failed with output".  
For details, see

  https://hydra.nixos.org/build/63802706

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_without_threads.i686-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build_without_threads.i686-linux’ has 
changed from "Dependency failed" to "Failed with output".  For details, see

  https://hydra.nixos.org/build/63802699

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_disable_networking on x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-master:build_disable_networking’ (on 
x86_64-linux) has changed from "Dependency failed" to "Failed with output".  
For details, see

  https://hydra.nixos.org/build/63802702

Go forth and fix it.

Regards,

The Hydra build daemon.



[Guile-commits] Success: Hydra job gnu:guile-2-0:build_enable_guile_debug on x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job ‘gnu:guile-2-0:build_enable_guile_debug’ (on 
x86_64-linux) has changed from "Dependency failed" to "Success".  For details, 
see

  https://hydra.nixos.org/build/63802723

Yay!

Regards,

The Hydra build daemon.



[Guile-commits] Failed with output: Hydra job gnu:guile-master:build_CPPFLAGS=_DSCM_DEBUG_TYPING_STRICTNESS=2 on x86_64-linux

2017-11-28 Thread Hydra Build Daemon
Hi,

The status of Hydra job 
‘gnu:guile-master:build_CPPFLAGS=_DSCM_DEBUG_TYPING_STRICTNESS=2’ (on 
x86_64-linux) has changed from "Dependency failed" to "Failed with output".  
For details, see

  https://hydra.nixos.org/build/63802701

Go forth and fix it.

Regards,

The Hydra build daemon.