On November 4, 2014 7:30:18 PM CET, Andrew MacLeod <amacl...@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 via email to