This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [ballen@uwm.edu] libc/2269: triginometric argument reduction error in libm
- To: Bruce Allen <ballen at gravity dot phys dot uwm dot edu>
- Subject: Re: [ballen@uwm.edu] libc/2269: triginometric argument reduction error in libm
- From: Andreas Jaeger <aj at suse dot de>
- Date: 20 May 2001 17:53:24 +0200
- Cc: Geoff Keating <geoffk at redhat dot com>, libc-alpha at sources dot redhat dot com, ballen at uwm dot edu, moshier at mediaone dot net
- References: <Pine.GSO.4.21.0105201028390.6437-100000@dirac>
Bruce Allen <ballen@gravity.phys.uwm.edu> writes:
> On Sun, 20 May 2001, Geoff Keating wrote:
>
> > Someone needs to fix libc/sysdeps/i386/fpu/s_sin.S so that it does
> > proper range reduction, I think. It works fine on non-x86 chips.
> >
> > Intel's manual (I was looking at the 'Pentium Processor Family
> > Developer's Manual, volume 3') has some spectacularly bad advice on
> > how to do range reduction. I would suggest ignoring it.
>
> Geoff,
>
> Could you please give a URL for this manual? I'm familiar enough with the
> problems of range reduction to be interested in seeing how they got it
> wrong.
Just for reference, I'm appending the ia32 double sin implementation.
Andreas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <machine/asm.h>
RCSID("$NetBSD: s_sin.S,v 1.5 1995/05/09 00:25:54 jtc Exp $")
ENTRY(__sin)
fldl 4(%esp)
fsin
fnstsw %ax
testl $0x400,%eax
jnz 1f
ret
.align ALIGNARG(4)
1: fldpi
fadd %st(0)
fxch %st(1)
2: fprem1
fnstsw %ax
testl $0x400,%eax
jnz 2b
fstp %st(1)
fsin
ret
END (__sin)
weak_alias (__sin, sin)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj