From: kernel mailz <kernelmailz@googlemail.com>
To: Brad Boyer <flar@allandria.com>
Cc: linuxppc-dev@ozlabs.org, gcc-help@gcc.gnu.org,
linux-kernel@vger.kernel.org
Subject: Re: Inline assembly queries [2]
Date: Sat, 4 Jul 2009 01:35:50 +0530 [thread overview]
Message-ID: <abe8a1fd0907031305r5cb9e2e8pec170bffb1c497ff@mail.gmail.com> (raw)
In-Reply-To: <20090703174031.GA12410@cynthia.pants.nu>
Hi Brad,
Thanks for responding.
My query was more on %U1%X1, I guess it is specifying U and/or X for %1 right ?
what does U/X stand for (is it similar to u - unsigned and x for a hex address)
are there any more literals like U/X/...
-Manish
On Fri, Jul 3, 2009 at 11:10 PM, Brad Boyer<flar@allandria.com> wrote:
> On Fri, Jul 03, 2009 at 12:14:41PM +0530, kernel mailz wrote:
>> Thanks for responding to my previous mail. A few more queries
>>
>> a. What is the use of adding format specifiers in inline assembly
>> like
>> asm volatile("ld%U1%X1 %0,%1":"=r"(ret) : "m"(*ptr) : "memory");
>
> The format specifiers limit which registers or addressing modes will
> be chosen to access that parameter. For example, if you're using an
> instruction that treats r0 as a literal 0 value, you can't use the
> "r" specifier for that or you may see problems if it happens to allocate
> r0 for that particular argument. For memory access, the "m" lets you
> use any of the normal load/store patterns (which is why this particular
> choice also requires the "%U1%X1" part to allow changing the instruction).
> The system was setup for an older style chip like x86 or 68k with many
> restrictions on which registers can be used where and large numbers of
> different addressing modes for accessing memory. It's a little clumsy
> for ppc by comparison to most other chips, but it's a fundamental part
> of inline assembly processing in gcc.
>
>> b. using m or Z with a memory address. I tried replacing m/Z but no change
>> Is there some guideline ?
>> gcc documentation says Z is obsolete. Is m/Z replaceable ?
>
> No idea. I don't remember ever seeing 'Z' used in anything. Maybe somebody
> else remembers what it used to mean.
>
> Brad Boyer
> flar@allandria.com
>
>
next prev parent reply other threads:[~2009-07-03 20:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-03 6:44 kernel mailz
2009-07-03 17:40 ` Brad Boyer
2009-07-03 20:05 ` kernel mailz [this message]
2009-07-03 21:19 ` Andreas Schwab
2009-07-03 20:57 ` Andreas Schwab
2009-07-06 6:56 ` Gabriel Paubert
2009-07-07 12:40 ` Andreas Schwab
2009-07-07 13:46 ` Gabriel Paubert
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=abe8a1fd0907031305r5cb9e2e8pec170bffb1c497ff@mail.gmail.com \
--to=kernelmailz@googlemail.com \
--cc=flar@allandria.com \
--cc=gcc-help@gcc.gnu.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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®