www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - volatile asm

reply Jason House <jason.james.house gmail.com> writes:
I was just looking at Atomic.d in the D2 port of tango and I see that all the
volatile keywords are commented out.  My understanding is that the ordering of
the assembly in those blocks is incredibly important to preserve as-is.  What
is the way to ensure that in D2?
Jan 21 2009
next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Wed, Jan 21, 2009 at 9:49 PM, Jason House
<jason.james.house gmail.com> wrote:
 I was just looking at Atomic.d in the D2 port of tango and I see that all=

ering of the assembly in those blocks is incredibly important to preserve a= s-is. What is the way to ensure that in D2? olol, use inline assembly or link to external functions that do that. That's what Walter told me, anyway. http://www.digitalmars.com/d/archives/digitalmars/D/announce/DMD_1.029_and_= 2.013_releases_11949.html#N11974
Jan 21 2009
prev sibling parent Sean Kelly <sean invisibleduck.org> writes:
Jason House wrote:
 I was just looking at Atomic.d in the D2 port of tango and I see that all the
volatile keywords are commented out.  My understanding is that the ordering of
the assembly in those blocks is incredibly important to preserve as-is.  What
is the way to ensure that in D2?

Walter has said that compilers should not optimize across asm blocks, and so a correct D compiler will not do so, and therefore the volatile label should be unnecessary. But I hope that this will be revisited once multiprogramming in D is a bit more fleshed out. Sean
Jan 21 2009