Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Nov 1996 02:01:46 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        frankch@waru.life.nthu.edu.tw, freebsd-current@FreeBSD.org
Subject:   Re: fast libm?
Message-ID:  <199611151501.CAA16104@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>    Our lab is planning to buy some PPro for scientific calculation.
>    We have previously test the performance of a PPro 200 running
>    FreeBSD and another running Linux.
>
>    The performance in the Linux box is 2 times faster than the
>    FreeBSD box. Through some investigation, we have found that the
>    problem is due to the math library. The Linux libm is optimized
>    for i386 machine, and written in assembly. Whereas FreeBSD libm
>    is written entirely in C.

Are you benchmarking it with your applications?  It is possible to
make the FreeBSD library look very bad by using a benchmark biased
towards the slowest functions in it, but I think the slowest functions
are rarely used.  FPU-intensive code tends to be limited by memory
bandwidth anyway.

I hope the Linux libm isn't optimized for i386's - i386's don't even
have FPU's, and PPro's are quite different.  The FreeBSD libm is not
entirely written in C - most of the functions directly supported by
the FPU are written in assembler and the assembler versions are used
if HAVE_FPU is defined in /etc/make.conf.

>    I wonder whether there's anyone trying to optimize libm in 
>    FreeBSD? I believe this will extend the use of FreeBSD in
>    scientific realms. 

Someone who uses it a lot will have to do it.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611151501.CAA16104>