From: Carl Spalletta <cspalletta@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: gcc inline asm - short question
Date: Mon, 18 Mar 2002 15:27:40 -0800 (PST) [thread overview]
Message-ID: <20020318232740.39289.qmail@web13305.mail.yahoo.com> (raw)
In studying the kernel I find many gcc inline 'asm' statements,
like so.
asm ( assembler template
: output operands (optional)
: input operands (optional)
: list of clobbered registers (optional)
);
I have read all the docs and I still can't clearly understand when it
is required to specify a clobberlist - a register or memory that will
be modified and must be preserved by gcc.
In searching the kernel source there were very few clobbers given
and most of those were for memory.
For example in arch/i386/lib/delay.c:
71 __asm__("mull %0"
72 :"=d" (xloops), "=&a" (d0)
73 :"1" (xloops),"" (current_cpu_data.loops_per_jiffy));
74 __delay(xloops * HZ);
It's pretty obvious that eax gets clobbered, as I know clobber. Why is
it not listed as such? Does the answer to this question apply in all cases?
What about memory clobbers - how do they happen?
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
next reply other threads:[~2002-03-18 23:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-18 23:27 Carl Spalletta [this message]
2002-03-18 23:50 ` Keith Owens
2002-03-19 5:27 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020318232740.39289.qmail@web13305.mail.yahoo.com \
--to=cspalletta@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®