[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] Handling multiple args in types.db
From: |
megane |
Subject: |
[Chicken-hackers] Handling multiple args in types.db |
Date: |
Fri, 26 Apr 2019 22:06:15 +0300 |
User-agent: |
mu4e 1.0; emacs 25.1.1 |
Hi folks!
Do you think that adding specializations for multiple argument calls to
mathematical functions is worth it? Like this:
diff --git a/types.db b/types.db
index b5bc766..e91c482 100644
--- a/types.db
+++ b/types.db
@@ -316,7 +316,10 @@
((integer integer) (integer)
(##core#inline_allocate ("C_s_a_u_i_integer_plus" 5) #(1) #(2)))
((* *) (number)
- (##core#inline_allocate ("C_s_a_i_plus" 29) #(1) #(2))))
+ (##core#inline_allocate ("C_s_a_i_plus" 29) #(1) #(2)))
+ ((* * *) (scheme#+ (scheme#+ #(1) #(2)) #(3)))
+ ((* * * *) (scheme#+ (scheme#+ #(1) #(2) #(3)) #(4)))
+ ((* * * * *) (scheme#+ (scheme#+ #(1) #(2) #(3) #(4)) #(5))))
The effects of doing this:
(define (foo x y z a)
(assume
([x float]
[y float]
[z fixnum]
[a fixnum])
(+ x y z a)))
;; Before (-O4 -debug 5)
(lambda (k146 x10 y11 z12 a13)
(let ((va162 (lambda (r161)
(k146 (##core#inline_allocate
("C_s_a_i_plus" 29)
r161
a13)))))
(let ((va164 (lambda (r163)
(va162 (##core#inline_allocate
("C_s_a_i_plus" 29)
r163
z12)))))
(va164 (##core#inline_allocate
("C_s_a_i_plus" 29)
x10
y11)))))
;; After
(lambda (k137 x10 y11 z12 a13)
(let ((a139 (##core#inline_allocate
("C_a_i_flonum_plus" 4)
x10
y11)))
(let ((a142 (##core#inline_allocate
("C_a_i_fix_to_flo" 4)
z12)))
(let ((a138 (##core#inline_allocate
("C_a_i_flonum_plus" 4)
a139
a142)))
(k137 (##core#inline_allocate
("C_s_a_i_plus" 29)
a138
a13))))))
- [Chicken-hackers] Handling multiple args in types.db,
megane <=
- Re: [Chicken-hackers] Handling multiple args in types.db, Peter Bex, 2019/04/26
- Re: [Chicken-hackers] Handling multiple args in types.db, megane, 2019/04/27
- Re: [Chicken-hackers] Handling multiple args in types.db, Peter Bex, 2019/04/27
- Re: [Chicken-hackers] Handling multiple args in types.db, megane, 2019/04/27
- Re: [Chicken-hackers] Handling multiple args in types.db, Peter Bex, 2019/04/27
- Re: [Chicken-hackers] Handling multiple args in types.db, megane, 2019/04/27
- Re: [Chicken-hackers] Handling multiple args in types.db, felix . winkelmann, 2019/04/27
- Re: [Chicken-hackers] Handling multiple args in types.db, felix . winkelmann, 2019/04/27