Re: Force consecutive operation when using asm volatile macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Andrew Haley wrote:
Jari Kuusisto wrote:

An this solution seems to be working, and performance values were now
improved. Could you please explain to me what this "memory" section in
asm line actually does?

Rather than asking Ian himself to explain it to you, please look in the docs.
It's called a memory clobber.

See 5.37 Assembler Instructions with C Expression Operands

Andrew.

I've read that documentation couple of times before but did not notice that memory clobber there before. Now that I know the feature I should use, I of course found the definition from the documentation.

But I still ain't exactly sure what the memory clobber actually does, but I assume that it prevents reordering code blocks before and after the specific asm command because it declares access to memory in an unpredictable fashion and GCC cannot move code blocks because of that.

Thanks for your help!

BR. Jari K.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux