gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Fwd: secret of rat3a/ctimes with gcl ?


From: Camm Maguire
Subject: Re: [Gcl-devel] Fwd: secret of rat3a/ctimes with gcl ?
Date: Fri, 29 Jun 2012 14:53:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Greetings!

Volker van Nek <address@hidden> writes:

> Greetings!
>
> 2012/6/22 Camm Maguire <address@hidden>
>
>     There are many such inline strings in GCL -- you can look at
>     gcl_cmpopt.lsp if you are interested.  The point of GCL though is to
>     hide as much of this from the user as possible and have the compiler
>     insert these in ordinary lisp at the right places.
>
> Thank you! gcl_cmpopt.lsp was very helpful to me. I wrote two more compiler 
> macros to successfully speed up my code.
>

Great!  Just a warning, if you modify the compiler::inline-always
property of symbols, you might produce incorrect lisp code unless you
understand the implications.  The first element in the list is a
signature, ((arg-types) return-type) which must match for the inline to
be applied.  The flags component has several bits which further qualify
this matching, the most important of which is compiler::rfa, aka
'return-type-from-arguments.  When present, the compiler will assume
that the return type of the inline is in fact the case if only the
argument types match.  This is especially important with fixnums, as you
must ensure that this relationship is correct.  For example, it would be
incorrect to apply '(((fixnum) fixnum) #.(flags rfa) "-#0") to '-, as
the negative of most-negative-fixnum is not a fixnum.  (2.7.0 has more
fine-graining here and can apply this to the appropriately restricted
range of fixnums).

>     >     What bugs do you see?  The balanced version passes all maxima 
> testsuite
>     >     tests.
>     >
>     > I think the crucial parts are as follows:
>    
>     If you can send me your whole file, I can likely spot this quickly.  If
>     *% works but not +%, then it should be simple.
>
> It took me a while but then I found that in your code two parantheses were 
> missing. Effectively the code reads as
>
> a + b % m
> a * b % m
>
> which means a + (b % m) and (a * b) % m and causes wrong results with + while 
> * was working.

Thanks!

>
> I continue in your next mail.
> Volker
>  
>
>     --
>     Camm Maguire                                       address@hidden
>     ==========================================================================
>     "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
>

-- 
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]