On 8688 day of my life Thomas Fischbacher wrote:
> On Fri, 19 Mar 2004, Alexey Dejneka wrote:
>
>> > my approach to this is to put a few macros into my own spellbook
>> > (google for cl-tf-spellbook, the university's webserver is down
>> > today, but you may have luck finding it in the Google cache) that
>> > expand, say, i+ to (the fixnum (+ (the fixnum arg1) (the fixnum
>> > arg2) ...) If you compile this with (declare (optimize (safety
>> > 0) (speed 3))), it just gives you what you want.
>>
>> Not quite. It works if the result of ordinary CL:+ is _really_ FIXNUM,
>> but if you try to lie the compiler, mysterious failures may appear.
>
> That is precisely what I am claiming. Most probably, he is not quite sure
> yet what he wants. :->
I am sure: I need fast modulo arithmetics.
The only one conforming way of implementing it is:
(defun fixnum+ (a b)
(declare ...)
(mod (+ a b) some-number))
(Not quite sure if I need MOD or other function). But I don't need
portable solution. I need fast solution (note: I asked CMUCL-specific
function in my first post).
Ideal solution should be compiled into single instruction:
ADD REG1,REG2
My goal is creating a compiler from one programming language that
doesn't need bugnums to Lisp. And I really-really need fast
arithmetics.
--
Ivan Boldyrev
Today is the first day of the rest of your life.