NetBSD Problem Report #57422

From www@netbsd.org  Fri May 19 15:13:29 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5C5621A923A
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 19 May 2023 15:13:29 +0000 (UTC)
Message-Id: <20230519151327.CCD761A923B@mollari.NetBSD.org>
Date: Fri, 19 May 2023 15:13:27 +0000 (UTC)
From: jspath55@gmail.com
Reply-To: jspath55@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Test for long double omitted in t_fpclassify automated framework cases
X-Send-Pr-Version: www-1.0

>Number:         57422
>Category:       misc
>Synopsis:       Test for long double omitted in t_fpclassify automated framework cases
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 19 15:15:00 +0000 2023
>Closed-Date:    
>Last-Modified:  Thu May 09 13:32:24 +0000 2024
>Originator:     Jim Spath
>Release:        10.0_BETA
>Organization:
>Environment:
NetBSD net.bsd 10.0_BETA NetBSD 10.0_BETA (GENERIC) #0: Sun Feb 12 12:39:37 UTC 2023  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64 x86_64 AMD 686-class NetBSD
>Description:
I read up on floating point and math operations after finding an issue with an earmv6hf system, and noticed test cases for "long double" were commented out in the t_fpclassify test case. There are tests for double and float.

lib/libc/gen/t_fpclassify:fpclassify_double,
lib/libc/gen/t_fpclassify:fpclassify_float,

In some tests, 3 "flavours" are covered:

lib/libc/gen/t_fpsetmask:fpsetmask_unmasked_double,
lib/libc/gen/t_fpsetmask:fpsetmask_unmasked_float,
lib/libc/gen/t_fpsetmask:fpsetmask_unmasked_long_double,

 tc-end: 1684374620.392177, fpsetmask_unmasked_double, skipped, FPU  does not implement traps on FP exceptions
 tc-end: 1684374620.666940, fpsetmask_unmasked_float, skipped, FPU does  not implement traps on FP exceptions
 tc-end: 1684374621.37833, fpsetmask_unmasked_long_double, skipped, FPU  does not implement traps on FP exceptions

PR 50937 relates to long double math ops, and was closed around the NetBSD 7 release time [2016].
"Unexpected and wrong result when print subnormal long double value"
(src/lib/libc/gdtoa: ldtoa.c; also noticed PR 57250, in 2023--"./test 1e309")

The t_fpclassify code says:

/*
 * XXX NetBSD doesn't have long-double flavors of frexp, ldexp, and modf,
 * XXX so this test is disabled.
 */

But now we do, from what the man says, e.g.:

     double
     frexp(double value, int *exp);

     float
     frexpf(float value, int *exp);

     long double
     frexpl(long double value, int *exp);



>How-To-Repeat:
cd /usr/tests
Run:
atf-run lib/libc/gen/t_fpclassify 

Note missing long double test case results.
>Fix:
Remove the skipper:

define TEST_LONG_DOUBLE

$ grep  "LONG_DOUBLE"  t_fpclassify.c
#ifdef TEST_LONG_DOUBLE
#endif /* TEST_LONG_DOUBLE */
#ifdef TEST_LONG_DOUBLE
#endif /* TEST_LONG_DOUBLE */

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 07 May 2024 21:20:29 +0000
State-Changed-Why:
I enabled the long double tests here:
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151200.html
Let's see how they go.


From: Jim Spath <jspath55@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/57422 (Test for long double omitted in t_fpclassify
 automated framework cases)
Date: Thu, 9 May 2024 08:11:30 -0400

 > State-Changed-From-To: open->feedback
 > State-Changed-By: riastradh@NetBSD.org
 > State-Changed-When: Tue, 07 May 2024 21:20:29 +0000

 I tested on a Pi0W running 10.0 with the new t_fpclassify program.

 Old:

 tp-start: 1715192221.271247, ./t_fpclassify, 2
 tc-start: 1715192221.272143, fpclassify_double
 tc-end: 1715192221.327241, fpclassify_double, failed,
 /usr/src/tests/lib/libc/gen/t_fpclassify.c:117: fpclassify(d1) !=
 FP_SUBNORMAL
 tc-start: 1715192221.340711, fpclassify_float
 tc-end: 1715192221.394704, fpclassify_float, failed,
 /usr/src/tests/lib/libc/gen/t_fpclassify.c:73: fpclassify(d1) !=
 FP_SUBNORMAL
 tp-end: 1715192221.406877, ./t_fpclassify
 info: time.end, Wed May 8 18:17:01 UTC 2024

 Old:

 tp-start: 1715192203.306604, ./t_fpclassify, 3
 tc-start: 1715192203.306762, fpclassify_double
 tc-end: 1715192203.362100, fpclassify_double, failed,
 /usr/src/tests/lib/libc/gen/t_fpclassify.c:117: fpclassify(d1) !=
 FP_SUBNORMAL
 tc-start: 1715192203.375191, fpclassify_float
 tc-end: 1715192203.432057, fpclassify_float, failed,
 /usr/src/tests/lib/libc/gen/t_fpclassify.c:73: fpclassify(d1) !=
 FP_SUBNORMAL
 tc-start: 1715192203.450880, fpclassify_long_double
 tc-end: 1715192203.506208, fpclassify_long_double, failed,
 /usr/src/tests/lib/libc/gen/t_fpclassify.c:161: fpclassify(d1) !=
 FP_SUBNORMAL
 tp-end: 1715192203.535430, ./t_fpclassify
 info: time.end, Wed May 8 18:16:43 UTC 2024

 The long double test now runs. I will file a new PR against the
 FP_SUBNORMAL results, as suggested.
 OK to close this.

State-Changed-From-To: feedback->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Thu, 09 May 2024 13:32:24 +0000
State-Changed-Why:
let's pull this up to netbsd-10 if not netbsd-9


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.