From owner-freebsd-stable Thu Apr 13 0:29:12 2000 Delivered-To: freebsd-stable@freebsd.org Received: from point.osg.gov.bc.ca (point.osg.gov.bc.ca [142.32.102.44]) by hub.freebsd.org (Postfix) with ESMTP id 4532E37BAC3 for ; Thu, 13 Apr 2000 00:29:09 -0700 (PDT) (envelope-from Cy.Schubert@uumail.gov.bc.ca) Received: (from daemon@localhost) by point.osg.gov.bc.ca (8.8.7/8.8.8) id AAA14827; Thu, 13 Apr 2000 00:28:22 -0700 Received: from passer.osg.gov.bc.ca(142.32.110.29) via SMTP by point.osg.gov.bc.ca, id smtpda14823; Thu Apr 13 00:28:04 2000 Received: (from uucp@localhost) by passer.osg.gov.bc.ca (8.9.3/8.9.1) id AAA53496; Thu, 13 Apr 2000 00:28:04 -0700 (PDT) Received: from cwsys9.cwsent.com(10.2.2.1), claiming to be "cwsys.cwsent.com" via SMTP by passer9.cwsent.com, id smtpdR53493; Thu Apr 13 00:27:33 2000 Received: (from uucp@localhost) by cwsys.cwsent.com (8.10.1/8.9.1) id e3D7RWh02100; Thu, 13 Apr 2000 00:27:32 -0700 (PDT) Message-Id: <200004130727.e3D7RWh02100@cwsys.cwsent.com> Received: from localhost.cwsent.com(127.0.0.1), claiming to be "cwsys" via SMTP by localhost.cwsent.com, id smtpdLj2087; Thu Apr 13 00:26:59 2000 X-Mailer: exmh version 2.1.1 10/15/1999 Reply-To: Cy Schubert - ITSD Open Systems Group From: Cy Schubert - ITSD Open Systems Group X-OS: FreeBSD 3.4-RELEASE X-Sender: cy To: Peter Jeremy Cc: Randall Hopper , stable@FreeBSD.ORG Subject: Re: float-to-double core dump on 3.4R In-reply-to: Your message of "Thu, 13 Apr 2000 13:35:26 +1000." <00Apr13.133526est.115284@border.alcanet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 13 Apr 2000 00:26:59 -0700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <00Apr13.133526est.115284@border.alcanet.com.au>, Peter Jeremy write s: > On 2000-Apr-09 10:02:46 +1000, Randall Hopper wrote: > > #include > > > > main() > > { > > float f = FLT_MAX; > > double d; > > f = f * 2; > > d = f; > > } > > > >Delete the "d=f" line and it doesn't core. Put it in and it does > >(floating-point exception). > > Exactly what version of -stable are you running? If you built your > own kernel, what version is /sys/i386/include/npx.h? > > The FP handling changed just before 4.0-RELEASE. 3.4 with npx.h from the 4.0 tree doesn't core dump. It's obviously the fix to this problem and the Acroread4 floating point core. Thanks to "Sean O'Connell" for sending me the fix. Here's the fix, from 4.0, that Sean sent me. --- npx.h.releng_3 Wed Apr 12 16:28:38 2000 +++ npx.h Wed Apr 12 16:33:36 2000 @@ -85,54 +85,24 @@ u_char sv_pad[64]; /* padding; used by emulators */ }; -/* Intel prefers long real (53 bit) precision */ -#define __iBCS_NPXCW__ 0x262 -/* wfj prefers temporary real (64 bit) precision */ -#define __386BSD_NPXCW__ 0x362 /* - * bde prefers 53 bit precision and all exceptions masked. - * - * The standard control word from finit is 0x37F, giving: + * The hardware default control word for i387's and later coprocessors is + * 0x37F, giving: * * round to nearest * 64-bit precision * all exceptions masked. * - * Now I want: + * We modify the affine mode bit and precision bits in this to give: * * affine mode for 287's (if they work at all) (1 in bitfield 1<<12) * 53-bit precision (2 in bitfield 3<<8) - * overflow exception unmasked (0 in bitfield 1<<3) - * zero divide exception unmasked (0 in bitfield 1<<2) - * invalid-operand exception unmasked (0 in bitfield 1<<0). * * 64-bit precision often gives bad results with high level languages * because it makes the results of calculations depend on whether * intermediate values are stored in memory or in FPU registers. - * - * The "Intel" and wfj control words have: - * - * underflow exception unmasked (0 in bitfield 1<<4) - * - * but that causes an unexpected exception in the test program 'paranoia' - * and makes denormals useless (DBL_MIN / 2 underflows). It doesn't make - * a lot of sense to trap underflow without trapping denormals. - * - * Later I will want the IEEE default of all exceptions masked. See the - * 0.0 math manpage for why this is better. The 0.1 math manpage is empty. */ -#define __BDE_NPXCW__ 0x1272 -#define __BETTER_BDE_NPXCW__ 0x127f - -#ifdef __BROKEN_NPXCW__ -#ifdef __FreeBSD__ -#define __INITIAL_NPXCW__ __386BSD_NPXCW__ -#else -#define __INITIAL_NPXCW__ __iBCS_NPXCW__ -#endif -#else -#define __INITIAL_NPXCW__ __BDE_NPXCW__ -#endif +#define __INITIAL_NPXCW__ 0x127F #ifdef KERNEL extern struct proc *npxproc; Regards, Phone: (250)387-8437 Cy Schubert Fax: (250)387-5766 Team Leader, Sun/DEC Team Internet: Cy.Schubert@osg.gov.bc.ca Open Systems Group, ITSD, ISTA Province of BC To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message