This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suggestions for extended asm
- To: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: Suggestions for extended asm
- From: Marek Michalkiewicz <marekm at linux dot org dot pl>
- Date: Sat, 13 May 2000 15:15:31 +0200 (CEST)
- CC: Denis Chertykov <denisc at overta dot ru>, Joern Rennecke <amylaar at cygnus dot co dot uk>, marekm at linux dot org dot pl, gcc at gcc dot gnu dot org
Michael Meissner <meissner@cygnus.com> wrote:
> The usual solution is to extend gas so it can reverse the sense of the test and
> do a jump around a jump. You always are fighting a losing game having the
> compiler know the lengths.
Yes (I see it is already done on a few other targets), though it may
be tricky on AVR: it would have to correctly handle conditional skip
instructions, which can only skip one real machine instruction, and only
if it is not a two-word instruction (AVR core bug with interrupts).
So the following ("skip" and "branch" used as general names for any
of the suitable AVR instructions):
skip
branch label
would generally need to be expanded to:
skip
branch 1f ; always one-word instruction
rjmp 2f
1:
rjmp label ; safe to expand to "jmp" if still out of range
2:
(some optimization is possible if branch is unconditional "rjmp" and
skip is not "cpse" which has no reverse condition form, but that might
be a little too much AVR assembler hackery for the GCC list :-).
> IMHO, what we should do is allow general attributes to be set (maybe adding
> another ':' followed by pairs of comma separated string strings.
Yes, that would be nice.
Thanks,
Marek