From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57578 invoked by alias); 1 Jul 2015 10:18:27 -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 57565 invoked by uid 89); 1 Jul 2015 10:18:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Jul 2015 10:18:18 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-26-0Yv3JQeKT0y8JzoLGEvk_w-1 Received: from localhost ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 1 Jul 2015 11:18:13 +0100 From: Richard Sandiford To: Richard Biener Mail-Followup-To: Richard Biener ,Trevor Saunders , GCC Patches , Mikhail Maltsev , richard.sandiford@arm.com Cc: Trevor Saunders , GCC Patches , Mikhail Maltsev Subject: Re: Add .def file for public target instructions References: <87ioaegtcp.fsf@googlemail.com> <20150701093910.GB11111@tsaunders-iceball.corp.tor1.mozilla.com> <878ub0nq06.fsf@e105548-lin.cambridge.arm.com> Date: Wed, 01 Jul 2015 10:18:00 -0000 In-Reply-To: <878ub0nq06.fsf@e105548-lin.cambridge.arm.com> (Richard Sandiford's message of "Wed, 01 Jul 2015 11:14:49 +0100") Message-ID: <874mlonpui.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: 0Yv3JQeKT0y8JzoLGEvk_w-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-07/txt/msg00022.txt.bz2 Richard Sandiford writes: > Richard Biener writes: >> On Wed, Jul 1, 2015 at 11:39 AM, Trevor Saunders >> wrote: >>> On Tue, Jun 23, 2015 at 07:41:42PM +0100, Richard Sandiford wrote: >>>> [A fair bit later than promised, sorry...] >>>> >>>> Mikhail posted a patch to make genflags generate the default HAVE_foo >>>> and gen_foo definitions that have recently been added to defaults.h: >>>> >>>> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00723.html >>>> >>>> I agree it'd be a good idea to generate this kind of thing automatical= ly, >>>> but I think we should take the opportunity to move the interface to the >>>> target structure. I.e.: >>>> >>>> HAVE_foo -> targetm.have_foo () >>>> gen_foo -> targetm.gen_foo () >>>> >>>> This should move us closer to the pipedream goal of supporting multiple >>>> targets at once. It should also mean that only the target code depends >>>> on insn-flags.h. >>> >>> using targetm. certainly seems like an improvement. I wonder if it >>> would be faster to stick this data on a per function object. I think >>> that would mean you could compute what insns are available once when the >>> function is created and afterwards all checks would only needed to be >>> reading computed values. >> >> I think the memory cost of this is prohibitive. > > Yeah. I did wonder about having optabs-like caching in some > target_globals structure, but I don't think it's really worth it. > In practice we only tend to call the have_*() functions when we're > trying to generate something (unlike optabs), and so any saving would > be dwarfed by the cost of generating whatever rtx we go on to create. ...plus (forgot the main reason): the condition for things like return and simple_return are only available after register allocation. Thanks, Richard