From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 997 invoked by alias); 4 Nov 2014 19:53:51 -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 986 invoked by uid 89); 4 Nov 2014 19:53:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f175.google.com Received: from mail-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 04 Nov 2014 19:53:46 +0000 Received: by mail-lb0-f175.google.com with SMTP id n15so3685335lbi.20 for ; Tue, 04 Nov 2014 11:53:42 -0800 (PST) X-Received: by 10.152.3.229 with SMTP id f5mr23804603laf.94.1415130822507; Tue, 04 Nov 2014 11:53:42 -0800 (PST) Received: from android-4c5a376a18c0e957.fritz.box (p4FE9D3C0.dip0.t-ipconnect.de. [79.233.211.192]) by mx.google.com with ESMTPSA id jj7sm496481lbc.5.2014.11.04.11.53.41 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 11:53:41 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: <54591B3A.8030908@redhat.com> References: <5458FE9C.2090409@redhat.com> <54590C19.40208@redhat.com> <54591348.1010904@redhat.com> <545913A4.5010400@redhat.com> <54591B3A.8030908@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [patch] Provide a can_compare_and_swap_p target hook. From: Richard Biener Date: Tue, 04 Nov 2014 19:53:00 -0000 To: Andrew MacLeod ,Richard Henderson ,gcc-patches CC: Jeff Law Message-ID: <70044BE8-9F38-4BDB-B73F-6E2FC9AC2629@gmail.com> X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00226.txt.bz2 On November 4, 2014 7:30:18 PM CET, Andrew MacLeod wrote: >On 11/04/2014 12:57 PM, Richard Henderson wrote: >> On 11/04/2014 06:56 PM, Andrew MacLeod wrote: >>> On 11/04/2014 12:25 PM, Richard Henderson wrote: >>>> On 11/04/2014 05:28 PM, Andrew MacLeod wrote: >>>>> + bool >>>>> + default_can_compare_and_swap_p (machine_mode mode, bool >allow_libcall) >>>>> + { >>>>> + return can_compare_and_swap_p (mode, allow_libcall); >>>>> + } >>>> This is silly. I think the problem you point out can be better >fixed by moving >>>> the can_compare_and_swap_p prototype elsewhere. >>>> >>> yeah, except it uses some of the optab table stuff that is static to >>> optabs.c... so the basic functionality remains there. >> I said move the prototype. Of course the implementation remains >where it is. >> >prototype is in optabs.h where it belongs since its defined in >optabs.c. :-) > >I'm not sure why this is much different than something like the >targhook >for builtin_support_vector_misalignment(), other than we are calling >the >routine in optabs.c rather than putting the actual code in targhooks.c. > >from targhooks.c: >bool >default_builtin_support_vector_misalignment (machine_mode mode, >const_tree type, <...>) > { > if (optab_handler (movmisalign_optab, mode) != CODE_FOR_nothing) > return true; > return false; >} > >the idea is to move all the functionality that front ends need into >well >defined and controlled places so we can increase the separation. "can >perform a compare_and_swap operation" is clearly a target specific >question isn't it? I would rather question what is so special about java that it needs to ask that and other frontends not. Don't we have generic atomics support now? Richard. >Andrew