[Zlib-devel] Re: zlib-1.2.0.f-cos2

Gilles Vollant info at winimage.com
Wed Sep 10 13:54:57 EDT 2003


Doing these test is a good idea. I'm interrested on result on different CPU.

There is three version of longest_match in x86 assembly code :
- one I wrote in 1996
- one written by Brian Raiter for 586 (first Pentium) and older
- one written by Brian Raiter for 686 (Pentium Pro and higher)

Brian Raiter original code is downloadable from
http://www.muppetlabs.com/~breadbox/software/assembly.html

When Pentium Pro was released, the C code compiled with Microsoft compiler
was faster than my assembly code.

So the contrib\masmx86 select :
- 686 code from Brian Raiter for Pentium pro and higher
- my 1996 assembly code for first Pentium, when w_mask == 0x7fff (for all
standard zip/gzip stream)
- C code elsewhere


Now, there is also same problem assembly code in the decompression from
Chris Anderson 
Chris say that MMX code is slower than no MMX on Pentium 4.

The better idea is probably determine, for each CPU (Intel and AMD) what is
the faster code : C with better compiler and one of the assembly code.
After, we will be able produce a version that select the better code
dynamically for current CPU, with same assembly code is each assembly syntax
.

-----Message d'origine-----
De : Zlib-devel-bounces at zlib.net [mailto:Zlib-devel-bounces at zlib.net] De la
part de Greg Roelofs
Envoyé : mercredi 10 septembre 2003 16:34
À : Zlib-devel at zlib.net
Objet : Re: [Zlib-devel] Re: zlib-1.2.0.f-cos2

> Greg: in contrib\masmx86, different implementations of longest_match() 
> are selected on the fly. True, you cannot select those by yourself, 
> but an ASM implementation can be accompanied by a function that allows 
> to select the user's preference, then match_init() can take care of 
> the initialization. Otherwise, in the standard code base, match_init() 
> is just an empty stub.

For my interest--doing performance tests against various optimizing C
compilers (i.e., trying to determine whether any of the assembler code is
useful these days)--automatic selection isn't useful.  But for most people
that's probably the best approach.

Greg






More information about the Zlib-devel mailing list