This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Suggestions for extended asm


On Fri, May 12, 2000 at 11:56:56PM +0400, Denis Chertykov wrote:
> Joern Rennecke <amylaar@cygnus.co.uk> writes:
> 
> > > 1. allow specifying the true length of assembler code
> > > inserted (equivalent of set_attr "length" ... in *.md,
> > > currently it is done by counting line separators in the
> > > string, but that might be unreliable if machine opcodes
> > > have different sizes or constructs like .rept/.endr are
> > > used).  This is significant to prevent assembler errors
> > > if branches have limited range (like -64/+63 on AVR).

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.

> > This is rather error prone.  I think you should rather fix the
> > machine description to use ADJUST_INSN_LENGTH to fix up the length of
> > assembelr insns.
> 
> Yes. I'm agree with you.
> Example:
> asm ("mov %0,%1 /* -*-insn-length-*- 1 */", ...
> 
> I can search the asm patterns, try to extract number after
> `-*-insn-length-*-' and after that correct the `length' attribute.

IMHO, what we should do is allow general attributes to be set (maybe adding
another ':' followed by pairs of comma separated string strings.

-- 
Michael Meissner, Cygnus Solutions, a Red Hat company.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]