Thread View: fa.netbsd.ports.alpha
1 messages
1 total messages
Started by Nicolas Joly
Sun, 26 Feb 2012 23:25
rint(3) ignore the prevailing rounding mode
Author: Nicolas Joly
Date: Sun, 26 Feb 2012 23:25
Date: Sun, 26 Feb 2012 23:25
60 lines
3196 bytes
3196 bytes
--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Hi,
Looking into the t_fpsetround testcase failure on alpha [1], i noticed
that rint does not alter its behaviour according to the prevailing
rounding mode.
The alpha machines do not use dynamic rounding mode by default unlinke
other archs. Compilation with default options enfore normal ieee
rounding mode, which does not take the fpcr bits into account at run
time.
To be sure, i recompiled the whole math library with rounding mode
option set to dynamic (patch attached), and this fixed the failing
test.
This seems the way to go, but i wonder if compiling the whole library
with dynamic rounding mode can have some bad side effects ? Do we need
to restrict it for rint function family ?
Thanks.
[1] http://www.netbsd.org/~njoly/alpha-atf/47_atf.html#lib_libc_gen_t_fpsetround_fpsetround_basic
--
Nicolas Joly
Projects and Developments in Bioinformatics
Institut Pasteur, Paris.
--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="netbsd-libmalpha.diff"
Content-Transfer-Encoding: 8bit
Index: lib/libm/Makefile
===================================================================
RCS file: /cvsroot/src/lib/libm/Makefile,v
retrieving revision 1.120
diff -u -p -r1.120 Makefile
--- lib/libm/Makefile 17 Sep 2011 10:51:52 -0000 1.120
+++ lib/libm/Makefile 26 Feb 2012 23:04:20 -0000
@@ -117,6 +117,10 @@ WARNS?=4
.PATH: ${.CURDIR}/src
.PATH: ${.CURDIR}/noieee_src
+.if (${MACHINE_ARCH} == "alpha")
+CFLAGS+= -mfp-rounding-mode=d
+.endif
+
.if (${MACHINE_ARCH} != "vax")
CPPFLAGS+= -D_MULTI_LIBM -D_POSIX_MODE
# XXX noieee libm is gross
--fUYQa+Pmc3FrFX/N--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads