From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36307 invoked by alias); 27 Aug 2019 22:44:37 -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 36298 invoked by uid 89); 27 Aug 2019 22:44:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=narrower, Joshi, joshi, Tejas X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Aug 2019 22:44:35 +0000 IronPort-SDR: EWWYFWXjUliambUCoVD3JisfILJjWn/Uc3ebkGT/MhiroQjlIZ5JFnwV0GEyvO+QNiZiOhS2Bk qZNQ67j7B7rtCN8vlgY+DMK7C3jVxle1gXjeuWP+eFsHzT2DCmmaCWbP966n8LE4jAW5VsSLLL e0G15y+0NsXOgAd4wLP0wFhhdhi5U+MHv1sDYdoKDv1g4DqA5bsIhC4d8y1N+1QkG9u5P1pl+Q 0OdEMW6qycQWPKQSXFeJhgaXmXJfm+UUR0ocBmEDo+iXnVJIanuwvmzF4Ku4rKLCPHUWzlvIWO UVM= Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 27 Aug 2019 14:44:33 -0800 IronPort-SDR: ghHJCEXPP2brwmMHiA8TawxelSi9Zpye0uNBW8zSV/VO7bZjpPb3nFbcQ8Ac8JE2ZJkY9JxPOH KdXoK8v1/9o0Kg93ea8KlmLYz/kXsYyGpAiMLKWcmIGajJxUcSD230zq3hxcCaZjJZR0WuozLG zRaflBTuEG86ajYTLWNsf746WTpoLgL6OifYIv/yp3hXoJIZ5WkL1MNRyxXxgA2+RGUdu6nOJ9 Bk7dMiuC/9FSFT+VF2ZvuaCaIjd+N4y8FEr0fJV+nDqW06YYd4KNFfecQFceogxU7VmGVn2xqe qUs= Date: Tue, 27 Aug 2019 23:47:00 -0000 From: Joseph Myers To: Tejas Joshi CC: , Martin Jambor , Subject: Re: [PATCH] builtin fadd variants implementation In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-Path: joseph@codesourcery.com X-SW-Source: 2019-08/txt/msg01848.txt.bz2 On Mon, 26 Aug 2019, Tejas Joshi wrote: > Hello. > I have made changes in the patch according to the above corrections. > However, I didn't understand how these following testcases are > supposed to handle. Will you please elaborate some more? > > > (E.g. fadd (0x1.000001p0, FLT_MIN), as an example from the glibc > > tests: cases where an intermediate rounding produces a result half way > > between two values of the narrower type, but the exact value is such that > > the result of fadd should end up with last bit odd whereas double rounding > > would result in last bit even in such half-way cases.) The point of this is to demonstrate that fadd (x, y) is different from (float) (x + y), by testing with inputs for which the two evaluate to different values. > > Then you should have some tests of what does *not* get optimized with > > given compiler options if possible. (Such a test might e.g. define a > > static fadd function locally that checks it gets called as expected, or > > else check the exceptions / errno if you rely on a suitable libm being > > available.) There would include: * A test where the result is within range but inexact; say fadd (1, DBL_MIN). With -ftrapping-math -fno-rounding-math, or -frounding-math -fno-trapping-math, or -frounding-math -ftrapping-math, this should not be folded; that is, it should be compiled to call a fadd function (which you might define in the test as a staic function that sets a variable to indicate that it was called, so the test can verify at runtime that the call did not get folded). * But the same inputs, with -fno-trapping-math -fno-rounding-math -fmath-errno, *should* get folded (so test the same inputs with those options with a link_error test like those for roundeven). * Then similarly test overflow / underflow cases (e.g. fadd (DBL_MAX, DBL_MAX) or fadd (DBL_MIN, DBL_MIN)) with -fno-trapping-math -fno-rounding-math -fmath-errno (make sure they don't get folded), and with -fno-trapping-math-fno-rounding-math -fno-math-errno (make sure that in that case they do get folded, so link_error tests). -- Joseph S. Myers joseph@codesourcery.com