remove >bignum in crc32 -- 2x faster on both 32 and 64bit

db4
Doug Coleman 2009-05-04 21:27:14 -05:00
parent 17607941b9
commit 249601618b
1 changed files with 3 additions and 3 deletions

View File

@ -12,12 +12,12 @@ CONSTANT: crc32-table V{ }
256 iota [ 256 iota [
8 [ 8 [
[ 2/ ] [ even? ] bi [ crc32-polynomial bitxor ] unless [ 2/ ] [ even? ] bi [ crc32-polynomial bitxor ] unless
] times >bignum ] times
] map 0 crc32-table copy ] map 0 crc32-table copy
: (crc32) ( crc ch -- crc ) : (crc32) ( crc ch -- crc )
>bignum dupd bitxor dupd bitxor
mask-byte crc32-table nth-unsafe >bignum mask-byte crc32-table nth-unsafe
swap -8 shift bitxor ; inline swap -8 shift bitxor ; inline
SINGLETON: crc32 SINGLETON: crc32