From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14627 invoked by alias); 21 Sep 2016 07:36:28 -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 14611 invoked by uid 89); 21 Sep 2016 07:36:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1636 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Sep 2016 07:36:17 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CD047AAD1; Wed, 21 Sep 2016 07:36:14 +0000 (UTC) Date: Wed, 21 Sep 2016 08:32:00 -0000 From: Richard Biener To: Joseph Myers cc: Michael Meissner , Tamar Christina , GCC Patches , "jakub@redhat.com" , "law@redhat.com" , nd Subject: Re: [PATCH] Optimise the fpclassify builtin to perform integer operations when possible In-Reply-To: Message-ID: References: <20160919221606.GA7906@ibm-tiger.the-meissners.org> <41217f33-3861-dbb8-2f11-950ab30a7021@arm.com> <20160920210324.GA8111@ibm-tiger.the-meissners.org> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2016-09/txt/msg01384.txt.bz2 On Wed, 21 Sep 2016, Joseph Myers wrote: > On Tue, 20 Sep 2016, Michael Meissner wrote: > > > It would be better to have a fpclassify2 pattern, and if it isn't > > defined, then do the machine independent processing. That is the way it is > > done elsewhere. > > But note: > > * The __builtin_fpclassify function takes arguments for all the possible > FP_* results, so the insn pattern would need to map the results to the > arguments passed to __builtin_fpclassify. (They are documented as needing > to be constants, of type int.) Yeah, that's the reason we "lower" this early. > * Then you want that mapping step to get optimized away in the case of a > comparison fpclassify (...) == FP_SUBNORMAL (for example), or a switch > over possible results. Will the RTL optimizers do that given the insns > structured appropriately? I think it makes sense to fold fpclassify (...) == N to more specific classification builtins that do not have this issue if possible. OTOH RTL expansion could detect some of the non-builtin ways to do such checks and see if an optab exists as well. > (For that matter, I don't know if the GIMPLE optimizers will optimize away > such a mapping either, but they clearly should. I've wondered what the > right approach would be for making FLT_ROUNDS properly depend on the > rounding mode - bug 30569, > - where the same issues > apply. For boolean operations such as isnan you don't have such > complications.) I think they do via jump-threading. Richard.