This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/3] Add atomic_compare_and_swap, atomic_exchange and atomic_fetch_add patterns.


On 15/06/2012, at 8:51 AM, Hans-Peter Nilsson wrote:

> On Thu, 14 Jun 2012, Maxim Kuvyrkov wrote:
>> On 14/06/2012, at 6:33 AM, Richard Sandiford wrote:
>>> Maxim Kuvyrkov <maxim@codesourcery.com> writes:
>>>> +/* Subroutines of the mips_process_sync_loop.
>>>> +   Emit barriers as needed for the memory MODEL.  */
>>>> +
>>>> +static bool
>>>> +mips_emit_pre_atomic_barrier_p (enum memmodel model)
>>>> +{
>>> Comment is a bit misleading because we don't emit anything here.
>> 
>> Yeap, forgot to update the comment after stealing the code from Alpha's port.
> 
> All this copy-pasting...  :(  I ranted the other day exactly
> about this copy-pasted function.
> 
> While you're editing in these parts, how about making this
> "bool emit_atomic_barrier_p (enum memmodel, bool pre)" and move it to
> the middle-end, say emit-rtl.c?
> 
> You don't have to change other ports, but you get the privilege
> of taunting them. :]

I've posted a separate patch to unify code for several targets.

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]