This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Converting MSVC to intel-style gcc inline assembly
- From: <tm_gccmail at kloo dot net>
- To: Jamie Lokier <jamie at shareable dot org>
- Cc: Andi Kleen <ak at muc dot de>, gcc at gcc dot gnu dot org
- Date: Mon, 8 Mar 2004 14:47:24 -0800 (PST)
- Subject: Re: Converting MSVC to intel-style gcc inline assembly
On Sat, 6 Mar 2004, Jamie Lokier wrote:
> Andi Kleen wrote:
> > What I meant is that when you change the stack pointer and gcc passes
> > in offset(%esp) for "m" then offset is not valid anymore. So you have
> > to be careful that this doesn't happen, e.g. by always using "r"
> > for anything local.
>
> It would be nice for GCC's operand formatting syntax ("%w0" etc.) to
> include a way to indicate a fixed numerical offset when the operand is
> on the stack. Code that needs pushes and pops tends to be the kind of
> code where there aren't enough registers to pass all the arguments,
> and anyway it's silly to force arguments into registers when it would
> be faster for the stack slot to be used directly.
>
> -- Jamie
You can store your operands in an auto struct, then pass in a pointer
to the struct.
This accomplishes most of what you want, sans referencing stuff
with the frame pointer.
Toshi