Bit blit routine, version 1
Torbjorn Granlund
tg at swox.com
Wed Feb 4 19:13:00 CET 2004
Brian Hurt <bhurt at spnz.org> writes:
> We have mpn_lshift and mpn_rshift already in GMP, and they
> are carefully optimized for all relevant processors. They
> implement what I mean with bit-blit.
>
> In what way is your code different from mpn_lshift and mpn_rshift?
>
>
My bitblit is a generalization of shift left/shift right routines. I
forget what the problems I had were, but when I looked into doing rotates
with the current implementation of the shifts, I hit problems.
You should definitely use mpn_lshift and mpn_rshift to do
the actual O(n) work. The first and last limbs will need special
handling, of course.
--
Torbjörn
More information about the gmp-devel
mailing list