[Openmcl-devel] Another 32/64-bit Example -- RayTrace

Gary Byers gb at clozure.com
Mon Oct 30 20:35:39 PST 2006



On Sun, 29 Oct 2006, Brent Fulgham wrote:

> Attached is a Lisp implementation of a simple raytracer that produces the 
> attached (somewhat cheesy) image for your amusement.
>
>

The bug that you found (ppc32 signaling a floating-point overflow in
1.1) was because AREF of a (SIMPLE-ARRAY DOUBLE-FLOAT (*)) (e.g., of a
simple double-float vector) was returning garbage.  (If you try to
sqare that particular piece of garbage, you will indeed overflow.)

The fact that it was going out of line to access the components of VEC
structures (which are implemented as simple double-float vectors)
suggested a fairly simple change; inlining the structure accessors
made the fact that double-floats were involved apparent and allowed it
to inline more FP arithmetic and sped things up by about 2.25x (and
consed about 30 gigabytes less ...)

That's certainly a step in the right direction and there may be a few
other pieces of low-hanging fruit worth picking off, but sooner or
later there's no more low-hanging fruit left ...




More information about the Openmcl-devel mailing list