From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7454 invoked by alias); 12 Aug 2009 18:08:18 -0000 Received: (qmail 6885 invoked by uid 22791); 12 Aug 2009 18:08:07 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from g5t0008.atlanta.hp.com (HELO g5t0008.atlanta.hp.com) (15.192.0.45) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Aug 2009 18:07:56 +0000 Received: from G5W0603.americas.hpqcorp.net (g5w0603.americas.hpqcorp.net [16.228.9.186]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by g5t0008.atlanta.hp.com (Postfix) with ESMTPS id BA167246FD; Wed, 12 Aug 2009 18:07:53 +0000 (UTC) Received: from G3W0058.americas.hpqcorp.net (16.232.1.3) by G5W0603.americas.hpqcorp.net (16.228.9.186) with Microsoft SMTP Server (TLS) id 8.1.375.2; Wed, 12 Aug 2009 18:07:00 +0000 Received: from GVW0436EXB.americas.hpqcorp.net ([16.234.32.153]) by G3W0058.americas.hpqcorp.net ([16.232.1.3]) with mapi; Wed, 12 Aug 2009 18:07:00 +0000 From: "Boehm, Hans" To: Andrew Haley , Paolo Bonzini CC: "Joseph S. Myers" , "java-patches@gcc.gnu.org" , Gcc Patch List Date: Wed, 12 Aug 2009 18:08:00 -0000 Subject: RE: Java: add flag_use_atomic_builtins Message-ID: <238A96A773B3934685A7269CC8A8D042577A01E71A@GVW0436EXB.americas.hpqcorp.net> 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="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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/msg00075.txt.bz2 At the risk of asking a stupid question, shouldn't all the code inside gcc = gradually migrate towards using the C++0x (and probably C1x) atomics, which= seem to be generally supported by gcc 4.4? There are known issues with __sync (no atomic loads and stores, underspecif= ied ordering), which is why there wasn't much of an effort topush the __syn= c interface into C++0x. Hans > -----Original Message----- > From: java-patches-owner@gcc.gnu.org=20 > [mailto:java-patches-owner@gcc.gnu.org] On Behalf Of Andrew Haley > Sent: Wednesday, August 12, 2009 10:15 AM > To: Paolo Bonzini > Cc: Joseph S. Myers; java-patches@gcc.gnu.org; Gcc Patch List > Subject: Re: Java: add flag_use_atomic_builtins >=20 > 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=20 > for things=20 > >>>>> such as sync_compare_and_swap. Instead, a routine in libgcc is=20 > >>>>> used. This patch adds a new gcj option, -fuse-atomic-builtins,=20 > >>>>> which causes gcj to use the routines in libgcc whenever atomic=20 > >>>>> operations are needed. > >>>> Wouldn't a target hook to allow a target to declare which=20 > >>>> operations it provides in libgcc be better than a=20 > command-line option? > >>> Maybe it would. I'm happy to work with anyone to create such a=20 > >>> thing. What would such a hook look like, and how would a=20 > front- end=20 > >>> use it? > >> Couldn't optabs be (re)used? > >=20 > > That would be nice. >=20 > I guess that's just a matter of >=20 > set_optab_libfunc (sync_compare_and_swap_optab, SImode,,=20 > SImode, SImode "__sync_bool_compare_and_swap_4"); >=20 > or somesuch? >=20 > Andrew. >=20