public inbox for
 help / color / mirror / Atom feed
From: Andrew MacLeod <>
To: Richard Biener <>,
	       Richard Henderson <>,
	       gcc-patches <>
Cc: Jeff Law <>, Andrew Haley <>,
Subject: Re: [patch] Provide a can_compare_and_swap_p target hook.
Date: Thu, 06 Nov 2014 17:57:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 11/04/2014 03:13 PM, Andrew MacLeod wrote:
> >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.
> True... I don't know if this is a thing that simply predates our 
> current level of support or if it is something else that is java 
> specific for its builtins.
> Don't know enough about java to comment.
> aph? Looks like you wrote the originals in 2006...   Can the java CAS 
> builtins simply use our current atomic calls rather than doing their 
> own thing and querying whether the target has a sync compare and swap 
> operation?
> Andrew
It looks like java is deciding whether or not GCC can inline atomic 
operations or not, and if it can't, doesn't want the atomic 
operations...   which presumably means there is no dependency on 
libatomic at runtime.

A call to can_compare_and_swap_p(mode) is analogous to a compile time 
version of folding atomic_always_lock_free(mode) to a constant...   
Frankly that seems like a reasonable question for some front end to 
ask...  and elect not to emit atomic calls if so desired. (which is what 
java is doing I think)

whether it still needs to do that is a question for some java person.


       reply	other threads:[~2014-11-06 17:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
     [not found] ` <>
     [not found]   ` <>
     [not found]     ` <>
     [not found]       ` <>
     [not found]         ` <>
     [not found]           ` <>
2014-11-06 17:57             ` Andrew MacLeod [this message]
2014-11-06 18:23               ` Andrew Haley
2014-11-06 19:05                 ` Andrew MacLeod
2014-11-07  9:31                   ` Andrew Haley
2014-11-07 13:31                     ` Andrew MacLeod

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* 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).