On Sun, Apr 10, 2011 at 5:47 AM, Jim Huang jim.huang@linaro.org wrote:
On 31 March 2011 08:23, Michael Hope michael.hope@linaro.org wrote:
Thanks all for your replies. I mixed these in with a bit of Googling and recorded them here: https://wiki.linaro.org/MichaelHope/Sandbox/LibrariesWithNeon
hi Michael,
Jan Seiffert implemented a series of adler32 vectorization for zlib: http://blackfin.uclinux.org/git/?p=users/vapier/zlib.git%3Ba=summary
ARM NEON and ARMv6 SIMD are included. It looks great and is being reviewed in zlib mailing-list: http://mail.madler.net/pipermail/zlib-devel_madler.net/2011-April/date.html
Hi jserv. I had a quick play with this on one of my machines. It looks promising but is a bit broken at the moment:
michaelh@ursa1:/scratch/michaelh/zlib$ gdb ./example ... Starting program: /scratch/michaelh/zlib/example zlib version 1.2.5 = 0x1250, compile flags = 0x155 uncompress(): hello, hello! gzread(): hello, hello! gzgets() after gzseek: hello! inflate(): hello, hello!
Program received signal SIGSEGV, Segmentation fault. 0x00015c48 in adler32_vec (adler=2363950230, buf=0x7b000 <Address 0x7b000 out of bounds>, len=0) at adler32_arm.c:162 162 in16 = *(const uint8x16_t *)buf; (gdb) back #0 0x00015c48 in adler32_vec (adler=2363950230, buf=0x7b000 <Address 0x7b000 out of bounds>, len=0) at adler32_arm.c:162 #1 0x00016446 in adler32 (adler=2363950230, buf=0x26008 "x\001\354\320\261\r", len=20000) at adler32.c:418 #2 0x0000b81c in read_buf (strm=0x7ebf3634, buf=0x44ba8 "", size=25536) at deflate.c:1005 #3 0x0000be7a in fill_window (s=0x39898) at deflate.c:1380 #4 0x0000c06c in deflate_stored (s=0x39898, flush=0) at deflate.c:1484 #5 0x0000b252 in deflate (strm=0x7ebf3634, flush=0) at deflate.c:822 #6 0x0000922e in test_large_deflate (compr=0x26008 "x\001\354\320\261\r", comprLen=40000, uncompr=0x2fc50 "hello, hello!", uncomprLen=40000) at example.c:281 #7 0x00009ca6 in main (argc=1, argv=0x7ebf37f4) at example.c:551
Richard, the implementation uses NEON intrinsics so it'd be interesting to see if your pack/unpack patches apply to it.
I'll mention this on the zlib-devel list.
-- Michael