linux-mips
[Top] [All Lists]

Re: Assembly macro with parameters

To: linux-mips@linux-mips.org
Subject: Re: Assembly macro with parameters
From: Fabrizio Fazzino <fabrizio@fazzino.it>
Date: Fri, 08 Apr 2005 18:47:58 +0200
In-reply-to: <20050407182549.GA24235@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <425573AD.9010702@fazzino.it> <20050407182549.GA24235@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
Ralf Baechle wrote:
Fabrizio Fazzino wrote:

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)");

Which will leave the assembler entirely unimpressed ;-)

I thought that the compiler was able to substitute also the
values inside strings... Is there any way to force it to do so?

Unless you only have a few instructions and are going for a quick hack
I really suggest to add proper support for these instructions to binutils.
Having working support in as, gdb, objdump will make your life so much
easier.

The processor I'm designing probably will not be implemented in
any way (we just have to simulate the VHDL hardware description),
so we just need a quick-and-dirty way to make the opcode
conversion.

        Fabrizio


--
============================================
   Fabrizio Fazzino - fabrizio@fazzino.it
     Fazzino.IT - http://www.fazzino.it
============================================



<Prev in Thread] Current Thread [Next in Thread>