Subject: Re: Number crunching in CLISP.

From: haible (Bruno Haible)
Date: Tue, 9 Aug 94 22:08:39 +0200

> If my memory serves me correctly, Bruno once told
> me that CLISP does all floating point operations by itself (i.e. -
> doesn't use the FPU).  Is this correct?

Yes, on most machines.

> If it does do floating point in software, how hard is it to
> change this?

Not very hard: add "#define FAST_DOUBLE" and "#define FAST_FLOAT" to
lispbibl.d, -fallow-single-precision to the CFLAGS in the makefile
(need gcc-2.6.0 for this), and recompile.

> Are floating point numbers stored in system format (as a C float)?

Yes, if the floating point operations are done in hardware, the
system format (i.e. IEEE) is used.

> Is the numerical code well isolated?

Yes, it is a single file called lisparit0.d.

But that won't help you much because while the floating point operations
are done in hardware, the boxing (allocating storage for the float)
and the function call and type dispatching overheads remain.

For these kinds of computations, try GCL. You will probably have to add
many disgusting (DECLARE (DOUBLE-FLOAT ...)) declarations to your program.
(Linux binaries are in ma2s2.mathematik.uni-karlsruhe.de:/pub/lisp/gcl/.)

Btw, your comparison isn't fair since the variable i is a local variable
in the C and a global (i.e. more expensive) variable in the Lisp version
of your benchmark.

                    Bruno Haible
                    [email-masked]

---

From: Reggie Perry <[email-masked]>
Date: Tue, 09 Aug 1994 16:29:33 -0700

> Received: from nz11.rz.uni-karlsruhe.de by muon.phys.washington.edu via SMTP (920330.SGI/911001.SGI)
> 	for reggie id AA05331; Tue, 9 Aug 94 13:07:30 -0700
> Received: from ma2s2.mathematik.uni-karlsruhe.de by nz11.rz.uni-karlsruhe.de 
>           with SMTP (PP); Tue, 9 Aug 1994 22:03:35 +0200
> Received: from (localhost) by ma2s2.mathematik.uni-karlsruhe.de (4.1/SMI-4.0) 
>           id AA02115; Tue, 9 Aug 94 22:10:08 +0200
> Date: Tue, 9 Aug 94 22:10:06 +0200
> Errors-To: [email-masked]
> Message-Id: <[email-masked]>
> Originator: [email-masked]
> Errors-To: [email-masked]
> Reply-To: clisp-list <[email-masked]>
> Sender: [email-masked]
> Version: 5.5 -- Copyright (c) 1991/92, Anastasios Kotsikonas
> From: [email-masked] (Bruno Haible)
> To: Multiple recipients of list <[email-masked]>
> Subject: Re: Number crunching in CLISP.
> 

	Is there any way to get the float operations unboxed with
proper declarations?

-Reggie