From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9095 invoked by alias); 12 Aug 2009 18:08:51 -0000 Received: (qmail 8256 invoked by uid 22791); 12 Aug 2009 18:08:43 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f225.google.com (HELO mail-fx0-f225.google.com) (209.85.220.225) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Aug 2009 18:08:36 +0000 Received: by fxm25 with SMTP id 25so165992fxm.29 for ; Wed, 12 Aug 2009 11:08:30 -0700 (PDT) Received: by 10.204.117.65 with SMTP id p1mr172347bkq.210.1250100487560; Wed, 12 Aug 2009 11:08:07 -0700 (PDT) Received: from scientist-2.local ([85.93.118.17]) by mx.google.com with ESMTPS id g28sm10013664fkg.15.2009.08.12.11.08.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Aug 2009 11:08:06 -0700 (PDT) Message-ID: <4A830520.5080207@gnu.org> Date: Wed, 12 Aug 2009 18:08:00 -0000 From: Paolo Bonzini User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Andrew Haley CC: "Joseph S. Myers" , java-patches@gcc.gnu.org, Gcc Patch List Subject: Re: Java: add flag_use_atomic_builtins References: <4A82E93B.5010504@redhat.com> <4A82F34B.2080404@redhat.com> <4A82F47A.7060708@gnu.org> <4A82F5C0.5000300@redhat.com> <4A82F88D.7030708@redhat.com> In-Reply-To: <4A82F88D.7030708@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2009-q3/txt/msg00076.txt.bz2 Andrew Haley wrote: > Andrew Haley wrote: >> Paolo Bonzini wrote: >>> On 08/12/2009 06:52 PM, Andrew Haley wrote: >>>> Joseph S. Myers wrote: >>>>> On Wed, 12 Aug 2009, Andrew Haley wrote: >>>>> >>>>>> Some targets, particularly ARM, don't have instructions for things >>>>>> such as sync_compare_and_swap. Instead, a routine in libgcc is >>>>>> used. This patch adds a new gcj option, -fuse-atomic-builtins, >>>>>> which causes gcj to use the routines in libgcc whenever atomic >>>>>> operations are needed. >>>>> Wouldn't a target hook to allow a target to declare which operations it >>>>> provides in libgcc be better than a command-line option? >>>> Maybe it would. I'm happy to work with anyone to create such a >>>> thing. What would such a hook look like, and how would a front- >>>> end use it? >>> Couldn't optabs be (re)used? >> That would be nice. > > I guess that's just a matter of > > set_optab_libfunc (sync_compare_and_swap_optab, SImode,, SImode, SImode "__sync_bool_compare_and_swap_4"); > > or somesuch? Yes, that's what I was too lazy to look up. Then possibly the middle-end needs to be taught about it rather than the front-end, I don't know. Paolo