From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69419 invoked by alias); 4 Jan 2019 12:19:15 -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 69398 invoked by uid 89); 4 Jan 2019 12:19:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:874, HTo:U*ebotcazou X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Jan 2019 12:19:13 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70624C05000F; Fri, 4 Jan 2019 12:19:12 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0F6060BE0; Fri, 4 Jan 2019 12:19:11 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x04CJ9rr007142; Fri, 4 Jan 2019 13:19:09 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x04CJ6GF007139; Fri, 4 Jan 2019 13:19:06 +0100 Date: Fri, 04 Jan 2019 12:19:00 -0000 From: Jakub Jelinek To: Eric Botcazou , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Re: [1/2] PR88598: Optimise x * { 0 or 1, 0 or 1, ... } Message-ID: <20190104121905.GZ30353@tucnak> Reply-To: Jakub Jelinek References: <87bm4wr6ku.fsf@arm.com> <1848503.BfMgXAnLGD@polaris> <87o98wpqna.fsf@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o98wpqna.fsf@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00156.txt.bz2 On Fri, Jan 04, 2019 at 12:13:13PM +0000, Richard Sandiford wrote: > > Can we avoid the gratuitous use of template here? We were told that C++ would > > be used only when it makes things more straightforward and it's the contrary > > in this case, to wit the need for the ugly RECURSE macro in the middle. > > I did it that way so that it would be easy to add things like > zero_or_minus_onep without cut-&-pasting the whole structure. IMHO we can make such a change only when it is needed. > The way to do that in C would be to use a macro for the full > function, but that's even uglier due to the extra backslashes. Or just make the function static inline and pass the function pointers to it as arguments? If it is inlined, it will be the same, it could be even always_inline if that is really needed. Jakub