[LLVMbugs] [Bug 11667] New: [Patch] assembly-written implementation of {u, }{div, mod}si3 for SPARC64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 28 04:33:20 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11667

             Bug #: 11667
           Summary: [Patch] assembly-written implementation of
                    {u,}{div,mod}si3 for SPARC64
           Product: compiler-rt
           Version: unspecified
          Platform: Sun
        OS/Version: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 7812
  --> http://llvm.org/bugs/attachment.cgi?id=7812
{u,}{div,mod}si3 for SPARC64

According to a developer at the FreeBSD project, FreeBSD's total compilation
time increases by 2.6% when the host system is built against compiler-rt
instead of libgcc. This is likely due to the fact that GCC has assembly-written
versions of the division and modulo routines, while compiler-rt does not.

The division and modulo routines used by GCC can easily be re-used by
compiler-rt. They are provided for free in The SPARC Architecture Manual
Version 8. Attached to this bug report is a patch that I have written for
compiler-rt. It contains the M4 file that is listed in the manual, with some
small modifications:

- The M4 file uses exponentiation (2^N). This seems to be a Sun-specific
extension to M4, as I cannot reproduce it with GNU and BSD m4. Fix this similar
to OpenBSD's version by replacing 2^N with TWOSUPN.

- Use the same register layout as GCC's version.

- Integrate into compiler-rt's codebase by using DEFINE_COMPILERRT_FUNCTION().

The patch lacks modifications to CMake files, but this is due to the fact that
we use a custom BSD makefile.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list