From: "Boehm, Hans" <hans.boehm@hp.com>
To: Andrew Haley <aph@redhat.com>, Paolo Bonzini <bonzini@gnu.org>
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,
"java-patches@gcc.gnu.org" <java-patches@gcc.gnu.org>,
Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: RE: Java: add flag_use_atomic_builtins
Date: Wed, 12 Aug 2009 18:08:00 -0000 [thread overview]
Message-ID: <238A96A773B3934685A7269CC8A8D042577A01E71A@GVW0436EXB.americas.hpqcorp.net> (raw)
In-Reply-To: <4A82F88D.7030708@redhat.com>
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, underspecified ordering), which is why there wasn't much of an effort topush the __sync interface into C++0x.
Hans
> -----Original Message-----
> From: java-patches-owner@gcc.gnu.org
> [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
>
> 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?
>
> Andrew.
>
next prev parent reply other threads:[~2009-08-12 18:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 16:09 Andrew Haley
2009-08-12 16:49 ` Joseph S. Myers
2009-08-12 16:54 ` Andrew Haley
2009-08-12 16:57 ` Paolo Bonzini
2009-08-12 17:05 ` Andrew Haley
2009-08-12 17:17 ` Andrew Haley
2009-08-12 18:08 ` Boehm, Hans [this message]
2009-08-12 18:25 ` Boehm, Hans
2009-08-12 18:27 ` Richard Guenther
2009-08-12 19:00 ` David Daney
2009-08-12 18:08 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=238A96A773B3934685A7269CC8A8D042577A01E71A@GVW0436EXB.americas.hpqcorp.net \
--to=hans.boehm@hp.com \
--cc=aph@redhat.com \
--cc=bonzini@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=java-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).