Václav Zeman | 2 Aug 2012 10:40
Picon
Gravatar

src/winsup/w32api ChangeLog include/winnt.h

On 1 August 2012 21:17,  <earnie <at> ...> wrote:
> CVSROOT:        /cvs/src
> Module name:    src
> Changes by:     earnie <at> ...   2012-08-01 19:17:37
>
> Modified files:
>         winsup/w32api  : ChangeLog
>         winsup/w32api/include: winnt.h
>
> Log message:
>         * include/winnt.h (MemoryBarrier): Add definition.
>
> Patches:
> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/ChangeLog.diff?cvsroot=src&r1=1.1121&r2=1.1122
> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/winnt.h.diff?cvsroot=src&r1=1.139&r2=1.140
>

+# else
+   FORCEINLINE VOID MemoryBarrier (VOID) {
+       LONG Barrier = 0;
+       __asm__ __volatile__("xchgl %%eax,%0 "
+         :"=r" (Barrier));
+   }

Since this is for GCC anyway, why not using __sync_synchronize() in
the body of the function instead?

--
VZ

(Continue reading)

Earnie Boyd | 2 Aug 2012 13:12
Picon

Re: src/winsup/w32api ChangeLog include/winnt.h

On Thu, Aug 2, 2012 at 4:40 AM, Václav Zeman wrote:
> On 1 August 2012 21:17,  <earnie <at> ...> wrote:
>> CVSROOT:        /cvs/src
>> Module name:    src
>> Changes by:     earnie <at> ...   2012-08-01 19:17:37
>>
>> Modified files:
>>         winsup/w32api  : ChangeLog
>>         winsup/w32api/include: winnt.h
>>
>> Log message:
>>         * include/winnt.h (MemoryBarrier): Add definition.
>>
>> Patches:
>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/ChangeLog.diff?cvsroot=src&r1=1.1121&r2=1.1122
>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/winnt.h.diff?cvsroot=src&r1=1.139&r2=1.140
>>
>
> +# else
> +   FORCEINLINE VOID MemoryBarrier (VOID) {
> +       LONG Barrier = 0;
> +       __asm__ __volatile__("xchgl %%eax,%0 "
> +         :"=r" (Barrier));
> +   }
>
> Since this is for GCC anyway, why not using __sync_synchronize() in
> the body of the function instead?

I found the code elsewhere and rather trust the author of that bit.
However, if you can provide test programs showing the differences of
(Continue reading)

Václav Zeman | 2 Aug 2012 14:54
Picon
Gravatar

Re: src/winsup/w32api ChangeLog include/winnt.h

On 2 August 2012 13:12, Earnie Boyd wrote:
> On Thu, Aug 2, 2012 at 4:40 AM, Václav Zeman wrote:
>> On 1 August 2012 21:17,  <earnie <at> ...> wrote:
>>> CVSROOT:        /cvs/src
>>> Module name:    src
>>> Changes by:     earnie <at> ...   2012-08-01 19:17:37
>>>
>>> Modified files:
>>>         winsup/w32api  : ChangeLog
>>>         winsup/w32api/include: winnt.h
>>>
>>> Log message:
>>>         * include/winnt.h (MemoryBarrier): Add definition.
>>>
>>> Patches:
>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/ChangeLog.diff?cvsroot=src&r1=1.1121&r2=1.1122
>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/winnt.h.diff?cvsroot=src&r1=1.139&r2=1.140
>>>
>>
>> +# else
>> +   FORCEINLINE VOID MemoryBarrier (VOID) {
>> +       LONG Barrier = 0;
>> +       __asm__ __volatile__("xchgl %%eax,%0 "
>> +         :"=r" (Barrier));
>> +   }
>>
>> Since this is for GCC anyway, why not using __sync_synchronize() in
>> the body of the function instead?
>
> I found the code elsewhere and rather trust the author of that bit.
(Continue reading)

Earnie Boyd | 2 Aug 2012 19:54
Picon

Re: src/winsup/w32api ChangeLog include/winnt.h

On Thu, Aug 2, 2012 at 8:54 AM, Václav Zeman wrote:
> On 2 August 2012 13:12, Earnie Boyd wrote:
>> On Thu, Aug 2, 2012 at 4:40 AM, Václav Zeman wrote:
>>> On 1 August 2012 21:17,  <earnie <at> ...> wrote:
>>>> CVSROOT:        /cvs/src
>>>> Module name:    src
>>>> Changes by:     earnie <at> ...   2012-08-01 19:17:37
>>>>
>>>> Modified files:
>>>>         winsup/w32api  : ChangeLog
>>>>         winsup/w32api/include: winnt.h
>>>>
>>>> Log message:
>>>>         * include/winnt.h (MemoryBarrier): Add definition.
>>>>
>>>> Patches:
>>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/ChangeLog.diff?cvsroot=src&r1=1.1121&r2=1.1122
>>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/winnt.h.diff?cvsroot=src&r1=1.139&r2=1.140
>>>>
>>>
>>> +# else
>>> +   FORCEINLINE VOID MemoryBarrier (VOID) {
>>> +       LONG Barrier = 0;
>>> +       __asm__ __volatile__("xchgl %%eax,%0 "
>>> +         :"=r" (Barrier));
>>> +   }
>>>
>>> Since this is for GCC anyway, why not using __sync_synchronize() in
>>> the body of the function instead?
>>
(Continue reading)

Earnie Boyd | 6 Aug 2012 17:54
Picon

Re: src/winsup/w32api ChangeLog include/winnt.h

On Thu, Aug 2, 2012 at 7:12 AM, Earnie Boyd wrote:
> On Thu, Aug 2, 2012 at 4:40 AM, Václav Zeman wrote:
>> On 1 August 2012 21:17,  <earnie <at> ...> wrote:
>>> CVSROOT:        /cvs/src
>>> Module name:    src
>>> Changes by:     earnie <at> ...   2012-08-01 19:17:37
>>>
>>> Modified files:
>>>         winsup/w32api  : ChangeLog
>>>         winsup/w32api/include: winnt.h
>>>
>>> Log message:
>>>         * include/winnt.h (MemoryBarrier): Add definition.
>>>
>>> Patches:
>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/ChangeLog.diff?cvsroot=src&r1=1.1121&r2=1.1122
>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/winnt.h.diff?cvsroot=src&r1=1.139&r2=1.140
>>>
>>
>> +# else
>> +   FORCEINLINE VOID MemoryBarrier (VOID) {
>> +       LONG Barrier = 0;
>> +       __asm__ __volatile__("xchgl %%eax,%0 "
>> +         :"=r" (Barrier));
>> +   }
>>
>> Since this is for GCC anyway, why not using __sync_synchronize() in
>> the body of the function instead?
>
> I found the code elsewhere and rather trust the author of that bit.
(Continue reading)

Earnie Boyd | 6 Aug 2012 18:07
Picon

Re: src/winsup/w32api ChangeLog include/winnt.h

On Mon, Aug 6, 2012 at 11:54 AM, Earnie Boyd wrote:
> On Thu, Aug 2, 2012 at 7:12 AM, Earnie Boyd wrote:
>> On Thu, Aug 2, 2012 at 4:40 AM, Václav Zeman wrote:
>>> On 1 August 2012 21:17,  <earnie <at> ...> wrote:
>>>> CVSROOT:        /cvs/src
>>>> Module name:    src
>>>> Changes by:     earnie <at> ...   2012-08-01 19:17:37
>>>>
>>>> Modified files:
>>>>         winsup/w32api  : ChangeLog
>>>>         winsup/w32api/include: winnt.h
>>>>
>>>> Log message:
>>>>         * include/winnt.h (MemoryBarrier): Add definition.
>>>>
>>>> Patches:
>>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/ChangeLog.diff?cvsroot=src&r1=1.1121&r2=1.1122
>>>> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/winnt.h.diff?cvsroot=src&r1=1.139&r2=1.140
>>>>
>>>
>>> +# else
>>> +   FORCEINLINE VOID MemoryBarrier (VOID) {
>>> +       LONG Barrier = 0;
>>> +       __asm__ __volatile__("xchgl %%eax,%0 "
>>> +         :"=r" (Barrier));
>>> +   }
>>>
>>> Since this is for GCC anyway, why not using __sync_synchronize() in
>>> the body of the function instead?
>>
(Continue reading)


Gmane