mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
add inline macros for zero? and 1-
* module/system/il/inline.scm (zero?, 1-): New inlines. Neat :) The loop benchmark speedup is now up to 5x.
This commit is contained in:
parent
e677365cbc
commit
6cc3f99e83
1 changed files with 6 additions and 0 deletions
|
@ -110,6 +110,9 @@
|
|||
(define-inline >= (x y)
|
||||
(ge? x y))
|
||||
|
||||
(define-inline zero? (x)
|
||||
(ee? x 0))
|
||||
|
||||
(define-inline +
|
||||
() 0
|
||||
(x) x
|
||||
|
@ -127,6 +130,9 @@
|
|||
(x y) (sub x y)
|
||||
(x y . rest) (sub x (+ y . rest)))
|
||||
|
||||
(define-inline 1-
|
||||
(x) (sub x 1))
|
||||
|
||||
(define-inline /
|
||||
(x) (div 1 x)
|
||||
(x y) (div x y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue