OpenSolaris

Printable Version Enter a New Search
Bug ID 6324631
Synopsis sparc hwmuldiv support should be in libc
State 10-Fix Delivered (Fix available in build)
Category:Subcategory library:libc
Keywords
Responsible Engineer Jonathan Adams
Reported Against
Duplicate Of
Introduced In
Commit to Fix snv_24
Fixed In snv_24
Release Fixed solaris_nevada(snv_24)
Related Bugs 6323803 , 6327152 , 6389189
Submit Date 15-September-2005
Last Update Date 16-February-2007
Description
Right now, there are a set of 64-bit multiplication and division support routines
for sparcv7 applications that are defined in both libc and the sun4u libc_psr:

    __div64
    __mul64
    __rem64
    __udiv64
    __umul64
    __urem64

As found in:

    6323803 compiler bug causes __*mul64 failure; svc.configd dies

the fact that sun4v's libc_psr does *not* have these routines makes life more 
complicated.  There is, in fact, no reason not to just add the contents of

    lib/libc_psr/sun4u/common/hwmuldiv.s

to lib/libc/sparc/crt/hwmuldiv.s, and compile that w/ -xarch=v8plus; libc already
has v8plus code in the atomic_* routines.  We could then remove:

lib/libc/sparc/crt/divrem64.c
lib/libc/sparc/crt/mul64.c
lib/libc/sparc/crt/muldiv64.il

and lower the size and complexity of the libc_psr libraries, to boot.  This will also
speed up 64-bit multiplies and divides on Niagara.
Removing the inlines for these functions also removes the
need to implement them separately for gcc.
Work Around
N/A
Comments
N/A