public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Andrew MacLeod <amacleod@redhat.com>,Richard Henderson
	<rth@redhat.com>,gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Jeff Law <law@redhat.com>
Subject: Re: [patch] Provide a can_compare_and_swap_p target hook.
Date: Tue, 04 Nov 2014 19:53:00 -0000	[thread overview]
Message-ID: <70044BE8-9F38-4BDB-B73F-6E2FC9AC2629@gmail.com> (raw)
In-Reply-To: <54591B3A.8030908@redhat.com>

On November 4, 2014 7:30:18 PM CET, Andrew MacLeod <amacleod@redhat.com> 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


  reply	other threads:[~2014-11-04 19:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 16:28 Andrew MacLeod
2014-11-04 17:26 ` Richard Henderson
2014-11-04 17:56   ` Andrew MacLeod
2014-11-04 17:58     ` Richard Henderson
2014-11-04 18:30       ` Andrew MacLeod
2014-11-04 19:53         ` Richard Biener [this message]
2014-11-04 20:13           ` Andrew MacLeod
2014-11-06 17:57             ` Andrew MacLeod
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:
  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=70044BE8-9F38-4BDB-B73F-6E2FC9AC2629@gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=rth@redhat.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).