[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Howto I/O in asm instructions?]

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Howto I/O in asm instructions?]
Date: Sun, 13 Jul 2008 21:31:04 +0200 (MET DST)

Dennis Clark <address@hidden> wrote:

>   Do we _really_ have to go through such pain just to write some
> in-line assembly in gcc?

What's your pain with it?

GCC's inline assembler is essentially tied deep into the compiler.
This allows for it to be /very/ flexible, and fully integrated into
the optimization framework of the compiler, as the developer can be
very explicit about specifying his needs.  The downside, of course, is
that a flexible method is usually not outright a simple one.

Contrast that with other compiler's inline asemblers where you
essentially have to know how the register allocator of the compiler is
going to work, so to guess which registers your operands might be in
when the inline assembler is executed -- and you could be completely
hosed with the next compiler version when someone tuned the register

My personal opinion (and I know others are sharing this one) is that
GCC's inline assembler is nothing to be used by beginners, but merely
by either experienced users, and even more by library developers.

>  THAT could sure use some streamlining in the avr-gcc
> compiler.

What exactly are you talking about here?  Do you really /know/ GCC's
inline assembler and its options?

>  In-line assembly is pretty much a must for embedded work.

Care to explain?

If you've got some time-critical function which you would want to
write an optimized assembly implementation for: do so.  Don't use the
inline assembler, but use a separate assembly source file.  I don't
see any reason why using an inline assembly statement would gain
anything in that situation.

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]