From patchwork Wed Aug 29 20:03:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 29114 Received: (qmail 68768 invoked by alias); 29 Aug 2018 20:03:09 -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 68757 invoked by uid 89); 29 Aug 2018 20:03:08 -0000 Authentication-Results: sourceware.org; auth=none 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: Wed, 29 Aug 2018 20:03:00 +0000 From: Joseph Myers To: Subject: Make gen-libm-test.py treat plus_oflow and minus_oflow as non-finite [committed] Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 When converting gen-libm-test to Python, in one place I noted a bug in the old Perl version that I preserved in the Python version so that the generated output files were the same with both versions, as such comparisons help give confidence in the correctness of such a rewrite of a script. Now that the conversion has been done, this patch fixes that bug, by arranging for tests with plus_oflow or minus_oflow results (manually written tests in libm-test-*.inc that have overflowing results that thus depend on the rounding mode) to be properly treated as having non-finite results, and thus not run for the __FINITE_MATH_ONLY__ tests. (As the affected tests in fact did pass for __FINITE_MATH_ONLY__ testing, this is just a matter of logical correctness in the choice of which tests run for that case, rather than fixing any actual test failures.) Tested for x86_64. Committed. 2018-08-29 Joseph Myers * math/gen-libm-test.py (gen_test_args_res): Also treat plus_oflow and minus_oflow as non-finite. diff --git a/math/gen-libm-test.py b/math/gen-libm-test.py index 8d156ea8d1..b6879d94f4 100755 --- a/math/gen-libm-test.py +++ b/math/gen-libm-test.py @@ -308,9 +308,7 @@ def apply_lit(arg, macro): def gen_test_args_res(descr_args, descr_res, args, res_rm): """Generate a test given the arguments and per-rounding-mode results.""" # Determine whether any arguments or results, for any rounding - # mode, are non-finite. (For consistency with the old perl - # script, this does not handle infinities resulting from - # ROUNDING_MAP.) + # mode, are non-finite. non_finite = False test_snan = False all_args_res = list(args) @@ -320,7 +318,8 @@ def gen_test_args_res(descr_args, descr_res, args, res_rm): if 'snan_value' in a: test_snan = True non_finite = True - elif 'qnan_value' in a or 'plus_infty' in a or 'minus_infty' in a: + elif ('qnan_value' in a or 'plus_infty' in a or 'minus_infty' in a + or 'plus_oflow' in a or 'minus_oflow' in a): non_finite = True # Process the arguments. args_disp = []