11 Aug
2014
11 Aug
'14
2:17 p.m.
Lars Hagström wrote:
Does that "memory" statement at the end add a fence both before and after the assembly statement?
Effectively. To be more precise, it turns the assembly statement into a compiler fence. "memory" tells the compiler to assume that the assembly code accesses and modifies memory in unpredictable ways, and the effect of that is basically a compiler fence. You should probably use the __asm__ and __volatile__ spellings as a matter of style though.