This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
asm and "cc" "memory" volatile etc.. (slightly offtopic)
- To: egcs at cygnus dot com
- Subject: asm and "cc" "memory" volatile etc.. (slightly offtopic)
- From: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Date: Tue, 11 Nov 1997 10:29:12 +0100
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
--