On 2/2/2015 1:39 AM, Johannes Pfau wrote:
No, it doesn't even come close.

* Ports.B += 7 doesn't work.

This should not be done with MMIO because the read and write cycles generated are ill-defined and vary based on obscure backend details.


In order to implement it you need a
   Volatile!ubyte wrapper, return by ref and avoid some compiler bugs

What compiler bugs?


* You do need force-inline to produce halfway decent code

Nope. volatileLoad() and volatileStore() do not produce function calls.


* You also need to enable backend optimization to produce decent code

Not any more true than with volatile types, because the compiler intrinsic actually translates to a volatile type, not a function call.


You are making a lot of assumptions that volatileLoad() and volatileStore() do not work. Please try it, examine the generated code, and see.

Reply via email to