[Zlib-devel] convert contrib\inflate86 to Intel/MASM mnemonic : I need help from one Unix user

Chris Anderson christop at charm.net
Sun Mar 9 16:35:01 EST 2003


On Sun, 2003-03-09 at 10:52, Gilles Vollant wrote:
> I've read the Intel2Gas documentation. It seem Intel2gas can convert
> from NASM format to gas AND from gas to NASM 
> 

I was able to use intel2gas to output something that NASM compiles and
links with MSVC (with a couple of minor modifications).  Intel2gas
doesn't have an option to output MASM compatible format (just from MASM
to AT&T, not the other way around), but I imagine I could derive that
from the NASM output.
 
> It's not easy to compiler Intel2gas in Win32 without GCC and Unix
> library.
> 

GCC does compile a Win32 object which can link with MSVC compiles
without using the cygwin library (gcc -c inffast.S -o inffast.obj), but
you still need gcc of course.

IMHO, the Right Way is to do what libpng does and inline the asm for gcc
and MSVC, which would remove the #define zstrm structure offsets
currently hard coded in the .S file.  I'll try to do something like
that.
 
> 
> The zlib 1.2.0 contain X86 assembly code to GNU/Linux for faster
> inflate.
>  
> Two remark :
> - the USE_MMX must be dynamic (the same code for both old computer and
> new MMX computer, with dynamic MMX detection). See png_mmx_support in
> LibPng

Yup.  I posted a dynamic MMX version to the list at the end of January
which didn't make it into zlib-1.2.0.  I'm ambivalent about it's
inclusion, since it really only helps on the p3 (by about 2%) and
actually makes things worse than compiler generated code on an Athlon. 
It's only slightly worse on the p4, so I think there may be some further
SSE optimizations that could help. The one I posted only uses MMX if the
cpu is a pentium < p4, although it still has -DNO_MMX, -DUSE_MMX, and
-DRUNTIME_MMX #ifdefs.  If nothing is defined, -DRUNTIME_MMX is used.

> - we must have both a MASM/Intel mnemonic version and GCC version.
> LibPng has both pnggccrd.c and pngvcrd.c (see
> http://www.libpng.org/pub/png/libpng.html )

Thank you, that will help.

>  
> There is a gvmat32.asm in MASM format (an old version in contrib\asm386
> of zLib, and a better version in
> http://www.winimage.com/zLibDll/buildzlib114dll.zip )
>  
> Note : there is Intel2Gas (
> http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/ ) to convert from
> Intel Mnemonic to Gnu syntax, but I don't known how revert
> 






More information about the Zlib-devel mailing list