Thread overview
volatile asm
Jan 22, 2009
Jason House
Jan 22, 2009
Sean Kelly
January 22, 2009
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?
January 22, 2009
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 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?

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
January 22, 2009
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