From: Fabrizio Fazzino <fabrizio@fazzino.it>
To: linux-mips@linux-mips.org
Subject: Assembly macro with parameters
Date: Thu, 07 Apr 2005 19:53:49 +0200 [thread overview]
Message-ID: <425573AD.9010702@fazzino.it> (raw)
Hi all,
I'm working to an hardware extension of the MIPS32 instruction set
and I need to convert my new instruction into an existing opcode
to make it possible for the normal GCC to correctly compile the code.
Just to be clear, to obtain my new FZMIN instruction like
FZMIN $rd, $rs, $rt
I have to convert it into
LWC1 $rt, rd<<11 ($rs)
that is an existing (in some cases unused) opcode.
I'm currently using hardcoded values for the parameters, so
fzmin(10,8,9) will be transformed into
asm("lwc1 $9, 10<<11($8)" : : : "$10");
It works, but I need a way to set the values of the parameters
at runtime; so I've tried the following macro:
#define fzmin(rd, rs, rt) asm("lwc1 $rt, rd<<11($rs)");
As you can imagine I'm not an expert of MIPS Assembly macros:
what I've written does NOT work since the values of rd,rs,rt
are NOT substituted inside the asm string.
Is there any way to do what I need? I would appreciate your
help very much.
Cheers,
Fabrizio
--
============================================
Fabrizio Fazzino - fabrizio@fazzino.it
Fazzino.IT - http://www.fazzino.it
============================================
next reply other threads:[~2005-04-07 17:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-07 17:53 Fabrizio Fazzino [this message]
2005-04-07 18:25 ` Assembly macro with parameters Ralf Baechle
2005-04-08 16:47 ` Fabrizio Fazzino
2005-04-08 16:57 ` Daniel Jacobowitz
2005-06-30 17:20 ` Fabrizio Fazzino
2005-06-30 17:32 ` David Daney
2005-07-01 8:38 ` Maciej W. Rozycki
2005-07-03 10:31 ` Fabrizio Fazzino
2005-07-04 7:40 ` Geert Uytterhoeven
2005-07-04 12:12 ` Maciej W. Rozycki
2005-07-09 7:22 ` Fabrizio Fazzino
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=425573AD.9010702@fazzino.it \
--to=fabrizio@fazzino.it \
--cc=linux-mips@linux-mips.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