[Top][All Lists]

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

Re: [Gcl-devel] Todo list...

From: Camm Maguire
Subject: Re: [Gcl-devel] Todo list...
Date: 21 May 2002 15:44:12 -0400


Raymond Toy <address@hidden> writes:

> >>>>> "James" == James Amundson <address@hidden> writes:
>     James> 1) f2cl-lib.lisp fails to compile because of some sort of internal 
>     James> error. I reported this to the GCL list, but I haven't pinned down 
> the
>     James> problem. I can work around the problem by not compiling f2cl-lib.
> Found the problem.  For some reason gcl generates incorrect C code for
> the following:
> (defun max0 (x y &rest z)
>   (declare (integer x y))
>   (apply #'max x y z))
> It doesn't like the declaration, so commenting it out allows gcl to
> compile f2cl-lib.lisp.  Hurray!

OK, I've looked at this.  The issue is with the GMP bignum support.
Apparently, the compiler emits macros which are only defined when GMP
(and pari) is not used.  

1) When one declares an integer in lisp, must one promote the
   arguments to bignums to be general?  (Probable answer - yes). 

2) The non-GMP, non-pari code declares the variables as an array of 4
   unsigned longs, setting the first to 0x1010000+4.  I have not
   looked at the pre-GMP bignum code, so am currently mystified by
   this.  Can anyone enlighten me?

This issue can be resolved by defining a few macros for the GMP and
pari cases, as soon as I know what they should be :-)!

3) We used to support pari (beyond bignums, I don't know if anything
   else was used.)  Would it be desireable to use it again for any
   interesting features?  (not bignums, as I think the gmp will be the
   best here for some time to come.  Hope to make small changes to the
   configure scripts to support ISA extensions in the GMP lib for huge
   performance boosts.)

> However, I now get warnings about INT being in the Lisp package and
> not defined when compiling ifix, idfix, aint, etc.  First, why is INT
> in the Lisp package, and, second, why does gcl warn about this?  Seems
> to work ok, though.

I think the message is misleading.  I'm trying to look at it now under
the C debugger.

>     James> 2) destructuring-bind is in the user package. I think it should be 
> in
>     James> the lisp package. I hadn't reported this problem yet because I 
> wanted to
>     James> make sure "lisp" is the right place. I'm pretty sure. I can 
> workaround
>     James> this with a #+gcl(import...), but it will get ugly if I workaround 
> it
>     James> now, then it gets fixed later. A fix now would be lovely.
> I see that destructuring-bind is now in the LISP package, but it's not
> exported so I've hacked around this by doing an import.  No more
> errors when compiling f2cl-lib.  
> Note, however, there are compiler warnings about do-arg-error-count
> not being defined.  Probably need to borrow the code from CMUCL or
> create your own equivalent.

Agreed.  Would be nice to get this to compile cleanly.  A lot of good
fortran code out there.  

Is there a c2cl-lib also?

>     James> 3) array-displacement is not in GCL. This is a real problem 
> because a
>     James> suitable replacement cannot be created at the user level.
>     James> array-displacement requires some information available only to the
>     James> implementation. I have a really hacky workaround, but it requires 
> adding
>     James> extra code every time make-array is called. This is high on my 
> list of
>     James> problems with GCL right now.
> Camm's latest rev for this works beautifully.  Although, I think it
> ought to work the same was as floor/ceiling does instead of consing up
> the result just so some lisp code and return it as tow values.  I'll see
> if I can't come up with a patch to implement this.

Agreed.  Did it this way for speed only, and to ape the existing
code :-).  Should be easy to do, replacing the cons with a pair of
vs_push's, like in Lceiling.  Might get to this sometime.

> With these changes, I've successfully built maxima with gcl.  Hurray!


> Ray

Take care,

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]