This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Architecture floating-point underflow information wanted
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>, <libc-ports at sourceware dot org>
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Richard Henderson<rth at twiddle dot net>, Mark Salter <msalter at redhat dot com>, Carlos O'Donell<carlos at systemhalted dot org>, Mike Frysinger <vapier at gentoo dot org>, Andreas Schwab<schwab at linux-m68k dot org>
- Date: Tue, 25 Sep 2012 12:52:16 +0000
- Subject: Architecture floating-point underflow information wanted
As part of fixing bug 14047, I'd like information about how each glibc
architecture (libc and ports) detects floating-point underflow. (IEEE
754-2008 gives two options: "before rounding" (exponent would be below
normal range if both exponent range and mantissa precision were unbounded)
and "after rounding" (exponent of the rounded value would be below normal
range if the exponent range were unbounded and values with all exponents
had the same mantissa precision as for normal values).)
You can identify the choice made by an architecture by running the
following program. The GCC and glibc versions used to build and run the
program don't matter, but it's best to run this on hardware not an
emulator since it's quite possible some emulators could get this sort of
detail wrong. It may also be possible to find this information in
architecture manuals.
#include <fenv.h>
#include <stdio.h>
volatile float a = 0x1.fffp-126;
volatile float b = 0x1.0008p-1;
volatile float c;
int
main (void)
{
feclearexcept (FE_ALL_EXCEPT);
c = a * b;
if (fetestexcept (FE_UNDERFLOW))
puts ("before rounding");
else
puts ("after rounding");
return 0;
}
I'm looking for information for the following architectures:
s390-32, s390-64
alpha
am33
hppa
ia64
m68k (classic)
I have the following information for architectures I have access to:
x86, x86_64: after rounding
powerpc32, powerpc64: before rounding
sh: after rounding
sparc32, sparc64: before rounding
arm: before rounding
m68k (coldfire): before rounding
mips32, mips64: after rounding
(Tile does not support the underflow exception so the question is
inapplicable there; I propose to use "before rounding" as a default for
such architectures for strto*.)
--
Joseph S. Myers
joseph@codesourcery.com