From 0073fcf11d25191b2ac90e77e60b7943e49cedcd Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Wed, 24 Oct 1990 16:42:48 +0000 Subject: [PATCH] Made the C callout stubs for the math library routines be inline, since the C call is pretty compact. --- code/irrat.lisp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/code/irrat.lisp b/code/irrat.lisp index 9496577de..bb69ae217 100644 --- a/code/irrat.lisp +++ b/code/irrat.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman (FAHLMAN@CMUC). ;;; ********************************************************************** ;;; -;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/irrat.lisp,v 1.4 1990/10/18 02:56:15 ram Exp $ +;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/irrat.lisp,v 1.5 1990/10/24 16:42:48 ram Exp $ ;;; ;;; This file contains all the irrational functions. Actually, most of the ;;; work is done by calling out to C... @@ -23,12 +23,15 @@ (defconstant pi 3.14159265358979323846264338327950288419716939937511L0) ;(defconstant e 2.71828182845904523536028747135266249775724709369996L0) +;;; Make these INLINE, since the call to C is at least as compact as a Lisp +;;; call, and saves number consing to boot. +;;; (defmacro def-math-rtn (name num-args) (let ((function (intern (concatenate 'simple-string "%" (string-upcase name))))) `(progn - (proclaim '(maybe-inline ,function)) + (proclaim '(inline ,function)) (export ',function) (def-c-routine (,name ,function) (double-float) ,@(let ((results nil)) @@ -81,10 +84,6 @@ ;;;; Power functions. -;;; Let the C stubs be opportunistically inline expanded. -;;; -(proclaim '(optimize (space 0))) - (defun exp (number) "Return e raised to the power NUMBER." (number-dispatch ((number number)) @@ -375,4 +374,3 @@ "Return the hyperbolic arc tangent of NUMBER." (log (* (1+ number) (sqrt (/ (- 1 (* number number))))))) -(proclaim '(optimize (space 1))) -- GitLab