Hi,
"Nathan Froyd" writes:
> On 8/14/07, Nikodemus Siivola wrote:
>> 2. 32 bit modular arithmetic not working on x86-64. Is this to be expected, is
>> this a regression, or am I doing something wrong? How hard would it be to
>> make it work?
>
> This is expected and somewhat unfortunate. I posted a patch to make
> this work several months ago:
>
> http://thread.gmane.org/gmane.lisp.steel-bank.devel/9155/
>
> Bill and Christophe expressed reservations about the patch, so I did
> not commit it.
I've resurrected my work towards making modular arithmetic choose
which width to use more cleverly than before, from patches I sent to
sbcl-devel in September. In particular, I have got
* better support for signed modular arithmetic: all LOGFOO functions
are treated as "good";
* preference for tagged modular arithmetic over untagged if the width
requested can be satisfied by both, unless the width matches
exactly.
Test case for before/after comparison:
(defun foom (x y)
(declare (fixnum x y))
(logand (logxor (+ x y) x) most-positive-fixnum))
This should allow two further pieces of work:
* support for signed word-sized (i.e. untagged) arithmetic;
* support for sub-word-sized untagged arithmetic, as in Nathan's
original work.
You can see my work-in-progress (and my inability to drive git
usefully) at
; I'm
attaching a patch for those who, like me, are not quite comfortable
with this particular VCS yet.
Nathan (or Nikodemus, or anyone else for that matter): are you in a
position to retry the x86-64 32-bit modular arithmetic on top of this?
Best,
Christophe