linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: loody <miloody@gmail.com>
Cc: Linux MIPS Mailing List <linux-mips@linux-mips.org>
Subject: Re: some question about Extended Asm
Date: Sun, 10 Jan 2010 17:14:48 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LFD.2.00.1001101708360.13474@eddie.linux-mips.org> (raw)
In-Reply-To: <3a665c761001100809g1400db9er5cc3a6228467934a@mail.gmail.com>

On Mon, 11 Jan 2010, loody wrote:

> I have some question about extended assembly in mips
> 1. is mips assembly in AT&T syntax?
>     from the document I google from the web, they emphasize that the
> GNU C compiler use AT&T syntax, and they list some example about intel
> instructions.

 I'm not sure if the "AT&T syntax" term has any meaning except for Intel 
architecture processors.

> But when I write the extended assembly in mips, I find it seem not AT&T syntax.
> The order of input and output is still the same as original mips instructions.
> Does that mean GNU compiler for mips doesn't use AT&T syntax?

 GNU as for MIPS processors uses the same syntax original tools provided 
by MIPS Computer Systems and Silicon Graphics companies used.  This syntax 
is used throughout all the documentation available and has nothing to do 
with the syntax used for Intel architecture processors (in particular, the 
specific instruction and not the data flow direction determines the order 
of operands).

> 2. how do we know which parameter is for %0,%1,etc?
> 
> suppose my src is as below
>  asm(
>                 "add %0, %1, %2\n"
>                 "sub %0,%2, %1\n"
>                 :"=r" (count)
>                 :"r" (temp), "r" (count)
>         );
> how do I know which parameter is %0, %1 and %2?
> there 2 variable, count and temp above, but in assembly it use 3 parameters.
> how to match them?

 See the Extended Asm chapter of the GCC manual.

  Maciej

  reply	other threads:[~2010-01-10 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06  7:13 some question about Extended Asm loody
2010-01-06 12:48 ` Maciej W. Rozycki
2010-01-10 16:09   ` loody
2010-01-10 17:14     ` Maciej W. Rozycki [this message]
2010-01-10 17:17       ` Geert Uytterhoeven

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=alpine.LFD.2.00.1001101708360.13474@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=miloody@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).