NetBSD Problem Report #48384

From martin@duskware.de  Sun Nov 17 14:51:59 2013
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EBA28A60ED
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 17 Nov 2013 14:51:59 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: some libm sources are incompatible with struct ieee_ext on some archs
X-Send-Pr-Version: 3.95

>Number:         48384
>Category:       lib
>Synopsis:       some libm sources are incompatible with struct ieee_ext on some archs
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 17 14:55:00 +0000 2013
>Closed-Date:    Sat Feb 01 19:06:35 +0000 2014
>Last-Modified:  Sat Feb 01 19:06:35 +0000 2014
>Originator:     Martin Husemann
>Release:        NetBSD 6.99.27
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD thirdstage.duskware.de 6.99.27 NetBSD 6.99.27 (MODULAR) #62: Fri Nov 15 12:44:00 CET 2013 martin@thirdstage.duskware.de:/usr/src/sys/arch/sparc64/compile/MODULAR sparc64
Architecture: sparc64
Machine: sparc64
>Description:

As witnessed by recent (new) test failures of fmodl() on sparc64, some code
in libm does not deal properly with the ieee_ext structure definition used
on ports where long double is 128bit. 

A quick glance shows the following files: 

e_fmodl.c s_ceill.c s_floorl.c s_fmaxl.c s_fminl.c s_frexpl.c
s_nextafterl.c s_nexttoward.c s_nexttowardf.c s_rintl.c s_truncl.c

assume mantissa is represented as ext_frach and ext_fracl, where on at least
hppa, mips64 and sparc64 we have additionally ext_frachm and ext_fraclm.

One option for fixing may be: change the struct ieee_ext definitions, making
ext_frach based on uint64_t (merging frachm into it) and joining fraclm and
fracl into a single uint64_t ext_fracl. No idea what fallout that would
cause.

The other option, of course, is making the libm code aware of the midle 
mantissa parts, #ifdef EXT_FRACLMBITS, but that might get messy.

>How-To-Repeat:
code inspection

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48384 CVS commit: src
Date: Wed, 20 Nov 2013 22:22:20 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Nov 20 22:22:20 UTC 2013

 Modified Files:
 	src/lib/libc/arch/sparc64/gen: fpclassifyl.c isinfl.c isnanl.c
 	src/sys/arch/sparc/include: ieee.h

 Log Message:
 PR 48384: reorganize struct ieee_ext for sparc64 to only use a high/low
 part for the mantissa.
 Adjust arch specific code accordingly.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/sparc64/gen/fpclassifyl.c
 cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sparc64/gen/isinfl.c \
     src/lib/libc/arch/sparc64/gen/isnanl.c
 cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sparc/include/ieee.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sat, 01 Feb 2014 19:06:35 +0000
State-Changed-Why:
fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.