From patchwork Wed Jan 13 04:38:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 1425606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ZwcKZB4S; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DFvqq6BvDz9sWC for ; Wed, 13 Jan 2021 15:39:50 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EBF173857C7A; Wed, 13 Jan 2021 04:39:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBF173857C7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610512786; bh=llZYNKN3dDWZ2ZyVYyt3RhOG4mjisQx6fr/fB2AX1ds=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ZwcKZB4SYAbKzXfQScFl8gILlBp0vpnFo7DyJFSiFiLsee55IEbulZvJwiildJUQo Baqpi1MVzx3stLceVc47NSD1tGLjyYL+YdaA8YvU0JK2IV+PWGJe1r05THfO8bP3WN l3HCt71dNpc/Wdpq139teMZcDEa3/Voyc2H6rrDc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from caracal.birch.relay.mailchannels.net (caracal.birch.relay.mailchannels.net [23.83.209.30]) by sourceware.org (Postfix) with ESMTPS id 7A5D83857C7A for ; Wed, 13 Jan 2021 04:39:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7A5D83857C7A X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 568321E2DC0; Wed, 13 Jan 2021 04:39:41 +0000 (UTC) Received: from pdx1-sub0-mail-a81.g.dreamhost.com (100-98-118-100.trex.outbound.svc.cluster.local [100.98.118.100]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 000A81E32CE; Wed, 13 Jan 2021 04:39:40 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a81.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.11); Wed, 13 Jan 2021 04:39:41 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Attack-Left: 49f37aad60ba6e2e_1610512781247_6424071 X-MC-Loop-Signature: 1610512781247:4033575836 X-MC-Ingress-Time: 1610512781246 Received: from pdx1-sub0-mail-a81.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a81.g.dreamhost.com (Postfix) with ESMTP id BF19A7DF17; Tue, 12 Jan 2021 20:39:40 -0800 (PST) Received: from rhbox.lan (unknown [103.199.172.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a81.g.dreamhost.com (Postfix) with ESMTPSA id 4D1428689B; Tue, 12 Jan 2021 20:39:37 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a81 To: libc-alpha@sourceware.org Subject: [PATCH v2] Use the right argument code in unnormal tests Date: Wed, 13 Jan 2021 10:08:56 +0530 Message-Id: <20210113043856.214762-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1166.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_ABUSEAT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Siddhesh Poyarekar via Libc-alpha From: Siddhesh Poyarekar Reply-To: Siddhesh Poyarekar Cc: joseph@codesourcery.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Use the right argument code (j) in the unnormal tests and cast inputs from the ieee_long_double_shape_type struct to Float64x to properly test it. --- Changes: - Dropped the TEST_COND_unnormal macro since TEST_COND_intel96 was sufficient; I failed to notice that TEST_COND_intel96 would only be true for long double. math/libm-test-driver.c | 12 +++++++----- math/libm-test-fpclassify.inc | 14 +++++++------- math/libm-test-isinf.inc | 14 +++++++------- math/libm-test-isnan.inc | 14 +++++++------- math/libm-test-issignaling.inc | 14 +++++++------- 5 files changed, 35 insertions(+), 33 deletions(-) diff --git a/math/libm-test-driver.c b/math/libm-test-driver.c index f7c0861c39..0a430a8606 100644 --- a/math/libm-test-driver.c +++ b/math/libm-test-driver.c @@ -328,7 +328,7 @@ struct test_f_i_data }; /* Used for RUN_TEST_LOOP_f_i_tg_u and RUN_TEST_LOOP_f_b_tg_u. */ #if TEST_COND_intel96 -struct test_f_i_data_u +struct test_j_i_data_u { const char *arg_str; ieee_long_double_shape_type arg; @@ -855,17 +855,19 @@ struct test_Ff_b1_data (ARRAY)[i].RM_##ROUNDING_MODE.expected, \ (ARRAY)[i].RM_##ROUNDING_MODE.exceptions); \ ROUND_RESTORE_ ## ROUNDING_MODE -#define RUN_TEST_LOOP_f_b_tg_u(FUNC_NAME, ARRAY, ROUNDING_MODE) \ +#define RUN_TEST_LOOP_j_b_tg_u(FUNC_NAME, ARRAY, ROUNDING_MODE) \ IF_ROUND_INIT_ ## ROUNDING_MODE \ for (size_t i = 0; i < sizeof (ARRAY) / sizeof (ARRAY)[0]; i++) \ - RUN_TEST_f_b_tg ((ARRAY)[i].arg_str, FUNC_NAME, (ARRAY)[i].arg.value, \ + RUN_TEST_f_b_tg ((ARRAY)[i].arg_str, FUNC_NAME, \ + (FLOAT)(ARRAY)[i].arg.value, \ (ARRAY)[i].RM_##ROUNDING_MODE.expected, \ (ARRAY)[i].RM_##ROUNDING_MODE.exceptions); \ ROUND_RESTORE_ ## ROUNDING_MODE -#define RUN_TEST_LOOP_f_i_tg_u(FUNC_NAME, ARRAY, ROUNDING_MODE) \ +#define RUN_TEST_LOOP_j_i_tg_u(FUNC_NAME, ARRAY, ROUNDING_MODE) \ IF_ROUND_INIT_ ## ROUNDING_MODE \ for (size_t i = 0; i < sizeof (ARRAY) / sizeof (ARRAY)[0]; i++) \ - RUN_TEST_f_i_tg ((ARRAY)[i].arg_str, FUNC_NAME, (ARRAY)[i].arg.value, \ + RUN_TEST_f_i_tg ((ARRAY)[i].arg_str, FUNC_NAME, \ + (FLOAT)(ARRAY)[i].arg.value, \ (ARRAY)[i].RM_##ROUNDING_MODE.expected, \ (ARRAY)[i].RM_##ROUNDING_MODE.exceptions); \ ROUND_RESTORE_ ## ROUNDING_MODE diff --git a/math/libm-test-fpclassify.inc b/math/libm-test-fpclassify.inc index c1c7e1ead1..1e30479473 100644 --- a/math/libm-test-fpclassify.inc +++ b/math/libm-test-fpclassify.inc @@ -38,13 +38,13 @@ static const struct test_f_i_data fpclassify_test_data[] = }; #if TEST_COND_intel96 -static const struct test_f_i_data_u fpclassify_test_data_u[] = +static const struct test_j_i_data_u fpclassify_test_data_u[] = { - TEST_f_i (fpclassify, pseudo_zero, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_i (fpclassify, pseudo_inf, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_i (fpclassify, pseudo_qnan, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_i (fpclassify, pseudo_snan, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_i (fpclassify, pseudo_unnormal, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_i (fpclassify, pseudo_zero, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_i (fpclassify, pseudo_inf, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_i (fpclassify, pseudo_qnan, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_i (fpclassify, pseudo_snan, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_i (fpclassify, pseudo_unnormal, FP_NAN, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), }; #endif @@ -53,7 +53,7 @@ fpclassify_test (void) { ALL_RM_TEST (fpclassify, 1, fpclassify_test_data, RUN_TEST_LOOP_f_i_tg, END); #if TEST_COND_intel96 - ALL_RM_TEST (fpclassify, 1, fpclassify_test_data_u, RUN_TEST_LOOP_f_i_tg_u, END); + ALL_RM_TEST (fpclassify, 1, fpclassify_test_data_u, RUN_TEST_LOOP_j_i_tg_u, END); #endif } diff --git a/math/libm-test-isinf.inc b/math/libm-test-isinf.inc index 7d4b27a45c..7eeb33c211 100644 --- a/math/libm-test-isinf.inc +++ b/math/libm-test-isinf.inc @@ -38,13 +38,13 @@ static const struct test_f_i_data isinf_test_data[] = }; #if TEST_COND_intel96 -static const struct test_f_i_data_u isinf_test_data_u[] = +static const struct test_j_i_data_u isinf_test_data_u[] = { - TEST_f_b (isinf, pseudo_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isinf, pseudo_inf, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isinf, pseudo_qnan, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isinf, pseudo_snan, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isinf, pseudo_unnormal, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isinf, pseudo_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isinf, pseudo_inf, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isinf, pseudo_qnan, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isinf, pseudo_snan, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isinf, pseudo_unnormal, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), }; #endif @@ -53,7 +53,7 @@ isinf_test (void) { ALL_RM_TEST (isinf, 1, isinf_test_data, RUN_TEST_LOOP_f_b_tg, END); #if TEST_COND_intel96 - ALL_RM_TEST (isinf, 1, isinf_test_data_u, RUN_TEST_LOOP_f_b_tg_u, END); + ALL_RM_TEST (isinf, 1, isinf_test_data_u, RUN_TEST_LOOP_j_b_tg_u, END); #endif } diff --git a/math/libm-test-isnan.inc b/math/libm-test-isnan.inc index 501bb1856f..c78143da37 100644 --- a/math/libm-test-isnan.inc +++ b/math/libm-test-isnan.inc @@ -38,13 +38,13 @@ static const struct test_f_i_data isnan_test_data[] = }; #if TEST_COND_intel96 -static const struct test_f_i_data_u isnan_test_data_u[] = +static const struct test_j_i_data_u isnan_test_data_u[] = { - TEST_f_b (isnan, pseudo_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isnan, pseudo_inf, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isnan, pseudo_qnan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isnan, pseudo_snan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (isnan, pseudo_unnormal, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isnan, pseudo_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isnan, pseudo_inf, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isnan, pseudo_qnan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isnan, pseudo_snan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (isnan, pseudo_unnormal, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), }; #endif @@ -53,7 +53,7 @@ isnan_test (void) { ALL_RM_TEST (isnan, 1, isnan_test_data, RUN_TEST_LOOP_f_b_tg, END); #if TEST_COND_intel96 - ALL_RM_TEST (isnan, 1, isnan_test_data_u, RUN_TEST_LOOP_f_b_tg_u, END); + ALL_RM_TEST (isnan, 1, isnan_test_data_u, RUN_TEST_LOOP_j_b_tg_u, END); #endif } diff --git a/math/libm-test-issignaling.inc b/math/libm-test-issignaling.inc index bea61a3664..3e27474f77 100644 --- a/math/libm-test-issignaling.inc +++ b/math/libm-test-issignaling.inc @@ -40,13 +40,13 @@ static const struct test_f_i_data issignaling_test_data[] = }; #if TEST_COND_intel96 -static const struct test_f_i_data_u issignaling_test_data_u[] = +static const struct test_j_i_data_u issignaling_test_data_u[] = { - TEST_f_b (issignaling, pseudo_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (issignaling, pseudo_inf, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (issignaling, pseudo_qnan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (issignaling, pseudo_snan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_b (issignaling, pseudo_unnormal, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (issignaling, pseudo_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (issignaling, pseudo_inf, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (issignaling, pseudo_qnan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (issignaling, pseudo_snan, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_j_b (issignaling, pseudo_unnormal, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), }; #endif @@ -55,7 +55,7 @@ issignaling_test (void) { ALL_RM_TEST (issignaling, 1, issignaling_test_data, RUN_TEST_LOOP_f_b_tg, END); #if TEST_COND_intel96 - ALL_RM_TEST (issignaling, 1, issignaling_test_data_u, RUN_TEST_LOOP_f_b_tg_u, END); + ALL_RM_TEST (issignaling, 1, issignaling_test_data_u, RUN_TEST_LOOP_j_b_tg_u, END); #endif }