[Zlib-devel] [4/6][RFC V2 Patch] Add an x86 version of Adler32

Jan Seiffert kaffeemonster at googlemail.com
Thu Mar 31 07:42:49 EDT 2011


2011/3/31 Vincent Torri <vtorri at univ-evry.fr>:
>
>
> On Wed, 30 Mar 2011, Jan Seiffert wrote:
>
>> And finally an x86 version of Adler32.
>>
>> it covers:
>> * Plain
>> * MMX
>> * SSE
>> * SSE2
>> * SSSE3
>> * 32 & 64 Bit
>> * PIC and non PIC
>>
>> And features a runtime cpu detection + dispatch.
>>
>> It heavily uses inline ASM, so it's restricted to GCC (or compatible
>> compiler, like clang).
>
> why not using yasm or nasm ?
>

The reason is in the next sentence:

>> This gives us help from the compiler for boilerplate code, all the
>> fiddling with calling conventions, PIC and bit-ness of the code.
>>

To get the code working on 32Bit & 64Bit, PIC (dll & .so) + static,
Windows + SysV would make it a macro nightmare.

Also in the V1 introduction:
No extra tools needed, the code gets autoselected by the preprocessor.
No changes to the make system. So it should break nothing for people
which do not use the code.

Changing that would mean:
Change the build system in some way so it automatically selects the
right code, without breaking it for people with exotic/old systems
develop a gigantic heap of abstractions/macros so the x86 code can be
build for all combinations (or create n copies)
(ex: ffmpeg or other such asm heavy software have such things, adding
a new asm function is a breeze, for zlib i would have to start at
zero)

But it could be an option to create pure asm files for the different
combinations by gcc which could then be included in the distribution
and feeded into the build.
Hmmmm, wait, scratch that, the inline asm strings stay the way they
are, whihc is AT&T syntax...
I have to think about it...

> Vincent Torri
>

Greetings
Jan


-- 
Shift happens.
			-- Doppler




More information about the Zlib-devel mailing list