This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

asm and "cc" "memory" volatile etc.. (slightly offtopic)


Hi
I have some problems with asm keyword. I still dont understand to some
details, and since it seems to be quite high conecentration of gcc
gurus here, I decided to ask at this list..

Imagine that you are writing some memcpy replacement (like rep movsb at intel)

do I need to write "cc" into modified registers, since it changes flags?
is such construction w/o "cc" bug? 

I probably need to write "memory" since it modifies memory, but what for example
in memchr case, wich just reads memory, do I put there "memory" too to force
gcc update all memory locations (and do not store some data in registers)

Is there some way to say gcc, that is just updates given block of memory
(rtl expression for memcpy dont say clobbers:memory but says set BLK...
is there any way to write this in asm?)

When exactly I need to write volatile? Does memcpy implementation need
volatile or fact, that it changes memory is enought for gcc to do not
make "bad" optimizations?
What it memchr case?
I know that I need to write volatile in thinks like "cli" but it is required
here too?

Thank you very much...

Honza
-- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]