From owner-freebsd-alpha Tue Jul 13 9: 6:41 1999 Delivered-To: freebsd-alpha@freebsd.org Received: from gate.keisu.t.u-tokyo.ac.jp (ns06.t.u-tokyo.ac.jp [133.11.68.1]) by hub.freebsd.org (Postfix) with SMTP id 678931531B for ; Tue, 13 Jul 1999 09:06:38 -0700 (PDT) (envelope-from simokawa@sat.t.u-tokyo.ac.jp) Received: (qmail 54657 invoked from network); 13 Jul 1999 16:06:38 -0000 Received: from sylph.sat.t.u-tokyo.ac.jp (10.6.1.20) by ns06.t.u-tokyo.ac.jp with SMTP; 13 Jul 1999 16:06:38 -0000 Received: from ett.sat.t.u-tokyo.ac.jp (ett.sat.t.u-tokyo.ac.jp [10.6.1.30]) by sylph.sat.t.u-tokyo.ac.jp (Postfix) with ESMTP id C75292DAA9; Wed, 14 Jul 1999 01:06:37 +0900 (JST) Received: from ett.sat.t.u-tokyo.ac.jp by ett.sat.t.u-tokyo.ac.jp (8.9.3/sat-V0.6) id BAA36196; Wed, 14 Jul 1999 01:06:37 +0900 (JST) Date: Wed, 14 Jul 1999 01:06:37 +0900 Message-ID: <14219.25613.478914.44162J@ett.sat.t.u-tokyo.ac.jp> From: Hidetoshi Shimokawa To: m.seaman@inpharmatica.co.uk Cc: FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-alpha@freebsd.org Subject: Re: alpha/12623: strtod(3) FPE on alphaev56 In-Reply-To: In your message of "Tue, 13 Jul 1999 12:27:40 +0100 (BST)" <199907131127.MAA09770@b0.farm.inpharmatica.co.uk> References: <199907131127.MAA09770@b0.farm.inpharmatica.co.uk> User-Agent: Wanderlust/1.0.0 (Kokomo) SEMI/1.13.3 (Komaiko) FLIM/1.12.5 (Hirahata) MULE XEmacs/21.2 (beta13) (Demeter) (i386-unknown-freebsd3.1) X-Face: OE([KxWyJI0r[R~S/>7ia}SJ)i%a,$-9%7{*yihQk|]gl}2p#"oXmX/fT}Bn7:#j7i14gu$ jgR\S*&C3R/pJX >Description: > > Attempting to convert the string "2.49521e-297" into a double > precision value via strtod(3) results in a floating point exception on > the alphaev56 CPU. The problem doesn't occur on i586. /usr/src/lib/libc/stdlib/strtod.c seems broken on alpha in three ways. 1) IEEE_8087 should be defined instead of IEEE_MC68k. 2) It assumes long is 32bit, but long is 64bit on alpha. s/unsigned long/u_int32_t/, s/long/int32_t/. 3) It generates denormal numbers which can not be treaded by the hardware on alpha. It should be compiled with the option `-mtrap-precision=i -mfp-trap-mode=su' to enable software completion. -- /\ Hidetoshi Shimokawa \/ simokawa@sat.t.u-tokyo.ac.jp PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message