Subject: port-m68k/3105: m68k/ldexp.S contains non-68060-only instructions
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ingolf@maus.rz.uni-jena.de>
List: netbsd-bugs
Date: 01/13/1997 22:19:22
>Number:         3105
>Category:       port-m68k
>Synopsis:       libc: m68k/gen/ldexp.S contains non-68060-only instructions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 13 13:35:03 1997
>Last-Modified:
>Originator:     Ingolf Koch
>Organization:
Ingolf Koch     Balin@IRC       ingolf@mipool.uni-jena.de
FSU Jena, Institut fuer Angewandte Mathematik, 07740 Jena
>Release:        1.2
>Environment:
System: NetBSD maus.rz.uni-jena.de 1.2 NetBSD 1.2 (MAUS) #1: Sat Jan 11 04:28:31 MET 1997 ingolf@maus.meka.fh-karlsruhe.de:/usr/src/sys/arch/amiga/compile/MAUS amiga


>Description:

The code for ldexp(3) located in usr/src/lib/libc/arch/m68k/gen/ldexp.S
contains instructions being emulated on 68060 processors.

The result is that a program which makes heavy use of ldexp() (eg. by
calling erand48(3) or so) slows down very much and its execution time
shows a system share of more than 80%.

As I've seen this on a 68040 machine, too, I believe the 68040 has the
same / a similar problem with ldexp().

>How-To-Repeat:

Compile the following program (with -m68060 option if you want, but has
nearly no effect) and /usr/bin/time its execution time.

----------------8<----------------
#include <math.h>

int
main(int, char **);

int
main(int ac, char **av) {
    int i;

    for(i=0; i<1000000; ++i)
        ldexp(1.0,2);

    return 0;
}
----------------8<----------------

>Fix:

None known as I'm no assembler expert.
Just replace the instructions in question by all-680x0 ones. :)
>Audit-Trail:
>Unformatted: