Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nemequ/liblzf.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Lehmann <schmorpforge@schmorp.de>2015-01-11 04:32:04 +0300
committerMarc Lehmann <schmorpforge@schmorp.de>2015-01-11 04:32:04 +0300
commitd71a793968b0dcaaa71eeae25165685aa98f522a (patch)
tree920371d45310c793c11e903060267eb0cde68d32
parent968e538ebd869be7da66e10db59c3d8bcfbb99cd (diff)
*** empty log message ***
-rw-r--r--bench.c12
-rw-r--r--lzf_c_best.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/bench.c b/bench.c
index 6cf47b7..793ae34 100644
--- a/bench.c
+++ b/bench.c
@@ -23,15 +23,15 @@ typedef unsigned long long stamp64;
extern inline tval stamp(void)
{
- tval tsc;
- asm volatile("rdtsc" : "=a" (tsc) : : "edx");
+ tval tsc; long dummy;
+ asm volatile("cpuid; rdtsc" : "=a" (tsc), "=d" (dummy) : "a" (0) : "ebx", "ecx");
return tsc;
}
extern inline tval measure(tval t)
{
- tval tsc;
- asm volatile("rdtsc" : "=a" (tsc) : : "edx");
+ tval tsc; long dummy;
+ asm volatile("cpuid; rdtsc" : "=a" (tsc), "=d" (dummy) : "a" (0) : "ebx", "ecx");
if (tsc>t)
return tsc-t;
else
@@ -45,7 +45,7 @@ static void sigu (int signum)
#define DSIZE 17318440
//#define DSIZE 32768
-#include "lzf_c_slow.c"
+#include "lzf_c_best.c"
unsigned char data[DSIZE], data2[DSIZE*2], data3[DSIZE*2];
@@ -86,7 +86,7 @@ int main(void)
//struct timeval tv; gettimeofday (&tv, 0);
//void *x = mmap (0, 16384, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE,-1,0);
- l = lzf_compress_slow (data, DSIZE, data2, DSIZE*2);
+ l = lzf_compress_best (data, DSIZE, data2, DSIZE*2);
//for (k = 0; k < l; ++k)
//printf ("1 %2d: %02x\n", k, data2[k]);
assert(l);
diff --git a/lzf_c_best.c b/lzf_c_best.c
index fe523d2..2474f8f 100644
--- a/lzf_c_best.c
+++ b/lzf_c_best.c
@@ -72,7 +72,7 @@ lzf_compress_best (const void *const in_data, unsigned int in_len,
u8 *out_end = op + out_len;
const u8 *first [1 << (6+8)]; /* most recent occurance of a match */
- u16 prev [MAX_OFF]; /* how many bytes to go backwards for te next match */
+ u16 prev [MAX_OFF]; /* how many bytes to go backwards for the next match */
int lit;
@@ -116,7 +116,7 @@ lzf_compress_best (const void *const in_data, unsigned int in_len,
}
diff = prev [((unsigned int)p) & (MAX_OFF - 1)];
- p = diff ? p - diff : (u8 *)diff;
+ p = diff ? p - diff : 0;
}
if (best_l)