PATCH: intmaths for data type `long long' under Solaris2 / Sparc32
esp5
esp5@rama.comp.pge.com
Mon Oct 8 11:12:00 GMT 2001
> Date: Sat, 6 Oct 2001 16:36:54 +0100
> From: ohme@dialeasy.de (Gert Ohme)
> To: esp5@rama.comp.pge.com
> Subject: PATCH: intmaths for data type `long long' under Solaris2 / Sparc32
> Cc: libc-alpha@sources.redhat.com
>
> Hi Ed.
>
> with the appended patch you get some code for the missing symbols __rem64,
> __div64, __mul64, __urem64 and __udiv64.
>
> Under Solaris those symbols in object-files are generated by gcc (see
> gcc-2.95.x/gcc/config/sparc/sol2.h and gcc-2.95.x/gcc/config/sparc/elf.h )
>
> The routines handle basic intmaths ( i.e. multiplication, division and
> remainder) for the data-type `(un)signed long long'.
>
>
> Some words to the appended files:
>
> mul64.S i have highly optimized for Sparc32-based machines, and it should
> be rewritten for Sparc64.
>
> The c-files contain the fastest algorithms to do the divrem that i know
> about. It is still missing checks like division by zero, and i measured
> it to run 2-4 times slower than the highly optimized installed
> os-machine-dependend library-routines.
>
> The appended code however can serve as a base for further optimisation.
> For example
> gcc -O3 -S rem64.c
> offers assembler code with which you can start further work.
>
> You can of course compare this assembler code with its equivalents in the
> Solaris2 based libc. Under Solaris2.6 do:
> ar -x /usr/lib/libc.a divrem64.o
> /usr/ccs/bin/dis divrem64.o > divrem64.ss
>
> Take into account again that the installed libc depends on the Solaris-version
> as well as the machinetype (i.e. available instruction set) of the system
> that you are working on.
>
> greetings
> Gert
Third question:
Exactly how do you get the makefile to recognize that the patch is in fact
there? (ie: how do you get it to be compiled and included inside of libc.a?)
Ed
More information about the Libc-alpha
mailing list