February 07, 2003
PPC Floating Point Compiler

Randall Beer has released a preliminary version of a floating point compiler for MCL and OpenMCL.

FPC-PPC compiles Lisp double-float expressions directly into PPC assembly language, producing code that is usually significantly faster and that allocates much less memory than the Lisp compiler.

For example, the following function takes about 370 ms to execute 100,000 times (on a 1GHz PowerBook G4; not including GC time) and allocates 14.4MB of memory on MCL 5.0b:

(defun euclidean-distance-3 (x1 y1 z1 x2 y2 z2)
  (let ((dx (- x1 x2))
        (dy (- y1 y2))
        (dz (- z1 z2)))
    (sqrt (+ (* dx dx) (* dy dy) (* dz dz)))))

Using FPC-PPC, the following executes in just 33 ms and allocates *no* memory:

(define-double-function  %euclidean-distance-3 (x1 y1 z1 x2 y2 z2)
  (let ((dx (- x1 x2))
        (dy (- y1 y2))
        (dz (- z1 z2)))
    (sqrt (+ (* dx dx) (* dy dy) (* dz dz)))))
Posted by jjwiseman at February 07, 2003 11:29 AM

You mean all this time the MCL JIT has been doing FP emulation? No wonder Lisp is dead! :-)

Posted by: Wes Felter on February 8, 2003 09:47 PM

From Beer's notes, the overhead he's avoiding is boxing/unboxing and tag checking, actually...

Posted by: Darius Bacon on February 9, 2003 02:50 AM
Post a comment

Email Address:


Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)


Remember info?