From 6cc3f99e83eaa3c6c8f4788695cd955235d2e712 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 25 May 2008 13:38:17 +0200 Subject: [PATCH] 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. --- module/system/il/inline.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/system/il/inline.scm b/module/system/il/inline.scm index 9a15bc7df..365946942 100644 --- a/module/system/il/inline.scm +++ b/module/system/il/inline.scm @@ -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)