Thread overview
[D-runtime] druntime commit, revision 479
Jan 06, 2011
dsource.org
Jan 06, 2011
Sean Kelly
Jan 06, 2011
Brad Roberts
Jan 06, 2011
Sean Kelly
January 06, 2011
druntime commit, revision 479


user: braddr

msg:
Fix atomicLoad for 64 bit.  Add a little unit testing for atomic operations.

http://www.dsource.org/projects/druntime/changeset/479

paths changed:
U   trunk/src/core/atomic.d

January 06, 2011
Why does the old approach not work on 64 bit when it works on 32 bit?

On Jan 5, 2011, at 11:32 PM, dsource.org wrote:

> druntime commit, revision 479
> 
> 
> user: braddr
> 
> msg:
> Fix atomicLoad for 64 bit.  Add a little unit testing for atomic operations.
> 
> http://www.dsource.org/projects/druntime/changeset/479
> 
> paths changed:
> U   trunk/src/core/atomic.d
> 
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime

January 06, 2011
The 32 bit code does what I changed the 64 bit code to do:  For example:

32 bit atomic byte load:
   asm
   {
       mov EAX, val;
       mov AL, [EAX];
   }

64 bit atomic byte load:
   asm
   {
       mov RAX, val;
       mov AL, [RAX];
   }


On 1/6/2011 6:40 AM, Sean Kelly wrote:
> Why does the old approach not work on 64 bit when it works on 32 bit?
> 
> On Jan 5, 2011, at 11:32 PM, dsource.org wrote:
> 
>> druntime commit, revision 479
>>
>>
>> user: braddr
>>
>> msg:
>> Fix atomicLoad for 64 bit.  Add a little unit testing for atomic operations.
>>
>> http://www.dsource.org/projects/druntime/changeset/479
>>
>> paths changed:
>> U   trunk/src/core/atomic.d
>>
>> _______________________________________________
>> D-runtime mailing list
>> D-runtime at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/d-runtime
> 
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime

January 06, 2011
I should have checked the code :-/.  I thought the intermediate load of val into the register was only required on x64.

On Jan 6, 2011, at 10:10 AM, Brad Roberts wrote:

> The 32 bit code does what I changed the 64 bit code to do:  For example:
> 
> 32 bit atomic byte load:
>   asm
>   {
>       mov EAX, val;
>       mov AL, [EAX];
>   }
> 
> 64 bit atomic byte load:
>   asm
>   {
>       mov RAX, val;
>       mov AL, [RAX];
>   }
> 
> 
> On 1/6/2011 6:40 AM, Sean Kelly wrote:
>> Why does the old approach not work on 64 bit when it works on 32 bit?
>> 
>> On Jan 5, 2011, at 11:32 PM, dsource.org wrote:
>> 
>>> druntime commit, revision 479
>>> 
>>> 
>>> user: braddr
>>> 
>>> msg:
>>> Fix atomicLoad for 64 bit.  Add a little unit testing for atomic operations.
>>> 
>>> http://www.dsource.org/projects/druntime/changeset/479
>>> 
>>> paths changed:
>>> U   trunk/src/core/atomic.d
>>> 
>>> _______________________________________________
>>> D-runtime mailing list
>>> D-runtime at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/d-runtime
>> 
>> _______________________________________________
>> D-runtime mailing list
>> D-runtime at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/d-runtime
> 
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime