axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] [#17 algebra BOOTSTRAP fixed point] Integer substituti


From: anonymous
Subject: [Axiom-developer] [#17 algebra BOOTSTRAP fixed point] Integer substitutions
Date: Mon, 17 Jan 2005 21:24:41 -0600

> ...
>PRIMELT 
> 
> The differences in the generated lisp are w.r.t QSADD1, in compiler
> generated code implementing a for loop. The differences look like:
> 
>     - (LETT |i| (+ |i| 1)
>     + (LETT |i| (QSADD1 |i|)
> 
> In primitiveElement, we use a for loop on `i in 10..'. i is passed to
> symmetricRemainder, defined in IntegerNumberSystem with signature:
> 
>     primitiveElement(%,%).
> 
> The call site takes the form primitiveElement(Integer, i), so we would
> expect that i should have type integer. Looking at the generated lisp
> for integer we see that QSADD1 is not on the property list for any
> function, but it is on the property list for SINT's `inc' function.
> 
> Note the definition of QSADD1 in vmlisp.lisp:
> 
>       (defmacro qsadd1 (x) `(the fixnum (1+ (the fixnum ,x))))
> 
> How does the compiler know on the second-iteration build that `i' will
> always be a fixnum? Though probably correct 99% of the time, the
> second-iteration code in this case is incorrect.

I don't understand the mechanism that makes this substitution but
in what sense is it incorrect. Can you give an example that might
apply the other 1% of the time? Do you mean because the magnitude
could exceed fixnum?


--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

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