From patchwork Fri Feb 9 22:57:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 871588 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-90204-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="hejm4J8q"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zdVnh37rDz9s7f for ; Sat, 10 Feb 2018 09:57:28 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=EjbScuKdlZ9aJhKmsoKs2EIVtJ8fi SgZto16Bu16wAVh5YRCqEDkN87by43Xxfi19fZ8Z8zfXQl3aa68aGalFy9WhAwFa cSrUdU3QLHinOyiTSCo/Nyn01z+LnT0j1GT+PREl9Jrp6WmVDYyPvTaWn0zLYW+n dm9B0wrRrkMJNo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=NAXxEO/CcSBTyWwwwFAnnOmGaxo=; b=hej m4J8qsIt+icVzJ8b5Ac7zfJN2RE7uK0YFXkEKLhSTlm11qjtCHKXRZORzQa6YVOO x8bxHyr6q3PWHrzMydXm6GBySCUbxdof0lKNVQa29yK7Oyj6DlWbg/yvbSP7oa/U +xgOdY1hKPfA7hY0e1wUmoZKygvx3g12bpOceW5Q= Received: (qmail 57115 invoked by alias); 9 Feb 2018 22:57:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 57100 invoked by uid 89); 9 Feb 2018 22:57:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Fri, 9 Feb 2018 22:57:15 +0000 From: Joseph Myers To: Subject: Handle narrowing function sNaN test disabling based on argument format [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) Testing narrowing functions for x86_64 with GCC 6 showed up a further testsuite fix needed: there is no _Float128 sNaN support before GCC 7 on x86_64 / x86, and the existing tests of SNAN_TESTS only checked it for the return type, not for the argument type. This patch fixes the code to check SNAN_TESTS (ARG_FLOAT) as well (in a variable set in libm-test-driver.c, since libm-test-support.c is compiled only once for each choice of FLOAT). Tested for x86_64 and x86 with GCC 6 in conjunction with the main patch adding narrowing add functions. Committed. 2018-02-09 Joseph Myers * math/libm-test-driver.c (snan_tests_arg): New variable. * math/libm-test-support.h (snan_tests_arg): New declaration. * math/libm-test-support.c (enable_test): Check snan_tests_arg. diff --git a/math/libm-test-driver.c b/math/libm-test-driver.c index 3713e70..30646da 100644 --- a/math/libm-test-driver.c +++ b/math/libm-test-driver.c @@ -27,6 +27,12 @@ const int flag_test_finite = TEST_FINITE; const int flag_test_inline = TEST_INLINE; const int flag_test_mathvec = TEST_MATHVEC; +#if TEST_NARROW +const int snan_tests_arg = SNAN_TESTS (ARG_FLOAT); +#else +const int snan_tests_arg = SNAN_TESTS (FLOAT); +#endif + #define STRX(x) #x #define STR(x) STRX (x) #define STR_FLOAT STR (FLOAT) diff --git a/math/libm-test-support.c b/math/libm-test-support.c index e59f15b..1a12ed6 100644 --- a/math/libm-test-support.c +++ b/math/libm-test-support.c @@ -985,7 +985,8 @@ enable_test (int exceptions) return 0; if (flag_test_finite && (exceptions & NON_FINITE) != 0) return 0; - if (!SNAN_TESTS (FLOAT) && (exceptions & TEST_SNAN) != 0) + if ((!SNAN_TESTS (FLOAT) || !snan_tests_arg) + && (exceptions & TEST_SNAN) != 0) return 0; if (flag_test_mathvec && (exceptions & NO_TEST_MATHVEC) != 0) return 0; diff --git a/math/libm-test-support.h b/math/libm-test-support.h index 64206ab..4263774 100644 --- a/math/libm-test-support.h +++ b/math/libm-test-support.h @@ -37,6 +37,7 @@ extern const int flag_test_exceptions; extern const int flag_test_finite; extern const int flag_test_inline; extern const int flag_test_mathvec; +extern const int snan_tests_arg; extern const char test_msg[]; extern const char qtype_str[]; extern const char doc[];