Mail Archives: djgpp/1996/05/06/14:03:24
Sengan DOT Short AT durham DOT ac DOT uk wrote:
>
> > This may be a stupid question but: why is it that when the math library is
> > not on the command line, it not only links and resolves the calls to pow
> > and ldexp, but it *works* too???
> > And, of course, if this program works without the library and crashes with
> > it, maybe you might try just not using the library for this situation...
> >
> > --
> > .*. "Clouds are not spheres, mountains are not cones, coastlines are not
> > -() < circles, and bark is not smooth, nor does lightning travel in a
> > `*' straight line." ,------------------------------------------------
> > -- B. Mandelbrot | Paul Derbyshire (PGD) ao950 AT freenet DOT carleton DOT ca
> >
>
> There appears to be a bug in the cygnus math library as far as pow and ldexp
> go. The solution is to use the functions in the standard libaries instead. They
> appear to work. (ie pow and ldexp are in two different libraries, and you can
> link in one or the other)
>
> Sengan
--
The solution is to change src/libm/src/s_scalbn.S to:
#include <machine/asm.h>
ENTRY(scalbn)
fidl 12(%esp)
fldl 4(%esp)
fscale /* Now we have result in ST(0) and */
/* 2nd operand in ST(1) */
fxch %st(1) /* Swap result and 2nd operand */
fincstp /* throw away operand, result is now TOS */
ret
gcc -c s_scalbn.S
and replace s_scalbn.o in libm.a
with
ar -rv libm.a s_scalbn.o
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -