Bit blit routine, version 1

Brian Hurt bhurt at spnz.org
Wed Jan 28 14:49:58 CET 2004


I finally got the bit-blit routine I've been working on on and off in good 
enough shape I thought I'd submit it for comments.  It's attached as a 
gzipped tar file- also included in the tar file is the test program I used 
to test the code and the make file to build/run the tests.  The current 
code passes all tests in both forwards and backwards mode.

Some more general comments:

- The code assumes a binary machine, but does not depend upon words being
a power of two bits.  So semi-weird machines like old Harris minis (24-bit
words), older crays (60-bit words), etc. should still work fine.  Truely
weird machines, like Base-10 mainframes etc., will need specialized
routines.

- The routine should provide reasonable performance on all machines.  I'm
at least reading and writting words in full chunks.  The most obvious
point for assembler optimization is the implementation of the double-word
shift (see the comment on the DBL_SHIFT macro).  The next most obvious
point for assembler optimization is the "core loops".  I need to take a 
look at MMX, and see if I can vectorize those loops.

- TEST_BACKWARDS is just a hack I put in to test the backwards copying,
which would normally only be done when the arrays overlap.

- I'm still not happy with the number of branchs- a "standard" call will 
hit 10-11 branchs, not counting the main loop.  Of course, this is 
constant overhead, so I'm not sure how much more optimization effort is 
worthwhile.  I've done several "reduce the number of branchs" spins over 
the code- every branch left is there for a very specific reason.

- I've tried to conform to the GMP standard code conventions.  Not sure I 
succeeded.  Stylistic nitpicking is welcome.

-- 
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 
Brian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bitblit.tar.gz
Type: application/x-gzip
Size: 8191 bytes
Desc: 
Url : /list-archives/gmp-devel/attachments/20040128/db54dad3/bitblit.tar.bin


More information about the gmp-devel mailing list