[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

akcl 589 released



I have just released AKCL version 586.

There are various changes to the debugger, to catching recursion,
and to the compiler.   There have been many miscellaneous bug fixes.
Support for hp 700 and 800 risc machines under hpux has been added.

The bignum support has been totally changed, using
a different representation, and stack support for intermediate
results.   INTEGER declarations now mean something.

A comparison of the old and new on computing the inverse
of pi using a scratchpad routine to 10000 and 20000 bits of accuracy is 

pi-inv   akcl-566  franz        lucid         old kcl/akcl
----------------------------------------
10000      3.3     9.2(2.8 X)  15.3 (4.6X)    92.7   (29.5 X)
20000      12.7    31.0(2.4 X) 62.2 (4.9X)    580.0  (45.5 X)

(defun pi-inv (bits &aux (m 0))
  (declare (integer bits m))
  (let* ((n (+ bits (integer-length bits) 11))
         (tt (truncate (ash 1 n) 882))
         (d (* 4 882 882))
         (s 0))
    (declare (integer s d tt n))
    (do ((i 2 (+ i 2))
         (j 1123 (+ j 21460)))
        ((zerop tt) (cons s (- (+ n 2))))
      (declare (integer i j))
        (setq s (+ s (* j tt))
              m (- (* (- i 1) (- (* 2 i) 1) (- (* 2 i) 3)))
              tt (truncate (* m tt) (* d (the integer (expt i 3))))))))

Detailed discussion:


A directory mp was added to hold the new multi precision arithmetic
code.  The layout and a fair amount of code in the mp directory is an
enhanced version of gpari version 34. The gpari c code was rewritten
to be more efficient, and gcc assembler macros were added to allow
inlining of operations not possible to do in C.  On a 68K machine,
this allows the C version to be as efficient as the very carefully
written assembler in the gpari distribution.  For the main machines,
an assembler file (produced by gcc) based on this new method, is
included.   This is for sites which do not have gcc, or do not
wish to compile the whole system with gcc.

Bignum arithmetic is much faster now.  Many changes were made to
cmpnew also, to add 'integer' as a new type.  It differs from
variables of other types, in that storage is associated to each such
variable, and assignments mean copying the storage.  This allows a
function which does a good deal of bignum arithmetic, to do very
little consing in the heap.  An example is the computation of PI-INV
in scratchpad, which calculates the inverse of pi to a prescribed
number of bits accuracy.  That function is now about 20 times faster,
and no longer causes garbage collection.  In versions of AKCL  where
HAVE_ALLOCA is defined, the temporary storage growth is on the C
stack, although this often not so critical (for example it makes
virtually no difference in the PI-INV example, since in spite of the
many operations, only one storage allocation takes place.
	
Bill Schelter