From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90555 invoked by alias); 23 Aug 2019 11:43:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 90528 invoked by uid 89); 23 Aug 2019 11:43:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1777 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Aug 2019 11:43:43 +0000 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "Cc" Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9E101B63A; Fri, 23 Aug 2019 11:43:40 +0000 (UTC) From: Martin Jambor To: Tejas Joshi , gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz, joseph@codesourcery.com Cc: Subject: Re: [PATCH] Builtin function roundeven folding implementation In-Reply-To: References: User-Agent: Notmuch/0.29.1 (https://notmuchmail.org) Emacs/26.2 (x86_64-suse-linux-gnu) Date: Fri, 23 Aug 2019 12:21:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg01641.txt.bz2 Hi, On Fri, Aug 23 2019, Tejas Joshi wrote: > Hi, > This is a full patch for the roundeven variants along with > documentation and additional testcases. The following code also > conforms to GNU's coding standards. > > Thanks, > Tejas > > 2019-08-22 Tejas Joshi > Martin Jambor > > * builtins.c (mathfn_built_in_2): Added CASE_MATHFN for ROUNDEVEN. > * builtins.def: Added function definitions for roundeven function > variants. > * fold-const-call.c (fold_const_call_ss): Added case for roundeven > function call. > * fold-const.c (negate_mathfn_p): Added case for roundeven function. > (tree_call_nonnegative_warnv_p): Added case for roundeven function. > (integer_valued_real_call_p): Added case for roundeven function. > * real.c (is_even): New function. Returns true if real number is even, > otherwise returns false. > (is_halfway_below): New function. Returns true if real number is > halfway between two integers, else return false. > (real_roundeven): New function. Round real number to nearest integer, > rounding halfway cases towards even. > * real.h (real_value): Added descriptive comments. Added function > declaration for roundeven function. > * doc/extend.texi (Other Builtins): List roundeven variants among > functions which can be handled as builtins. > > gcc/testsuite/ChangeLog: > > 2019-08-21 Tejas Joshi > > * gcc.dg/torture/builtin-round-roundeven.c: New test. > * gcc.dg/torture/builtin-round-roundevenf128.c: New test. For the record, I bootstrapped and tested the patch on an x86_64-linux and it passes both fine. Joseph, please have a look and hopefully this is the version that I can commit? Thanks, Martin