summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2007-11-13 08:38:35 +0000
committerroot <root>2007-11-13 08:38:35 +0000
commite71bc36b15d3ea74a1de596c2de0217c2be3eed6 (patch)
treee9d1eca3bdbc58778df02ba8b7a4396eb8144330
parenta097fcd099d2e2bb649a1de8e0e10909ac470770 (diff)
unroll a bit for testing
-rw-r--r--lzf_c.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/lzf_c.c b/lzf_c.c
index 554e996..bd44027 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -160,18 +160,18 @@ lzf_compress (const void *const in_data, unsigned int in_len,
if (expect_false (op + lit + 1 + 3 >= out_end))
return 0;
- if (lit)
+ if (expect_false (lit))
{
*op++ = lit - 1;
lit = -lit;
do
*op++ = ip[lit];
- while (++lit);
+ while (expect_false (++lit));
}
for (;;)
{
- if (expect_true (ip < in_end - 2 - 8 && maxlen > 8))
+ if (expect_true (maxlen > 16))
{
len++; if (ref [len] != ip [len]) break;
len++; if (ref [len] != ip [len]) break;
@@ -181,6 +181,14 @@ lzf_compress (const void *const in_data, unsigned int in_len,
len++; if (ref [len] != ip [len]) break;
len++; if (ref [len] != ip [len]) break;
len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
}
do
@@ -248,7 +256,7 @@ lzf_compress (const void *const in_data, unsigned int in_len,
*op++ = MAX_LIT - 1;
#ifdef lzf_movsb
- ip -= lit;
+ ip -= MAX_LIT;
lzf_movsb (op, ip, lit);
#else
lit = -lit;