This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS gas relaxation still doesn't work


>While I agree with you in theory, how would GCC handle user-written
>asm("") blocks without an assemble-time jump relaxation of some sort?

That is a problem I haven't considered in detail.

We don't have to worry about handling branches inside the extended asm.  Gcc
doesn't allow branching into or outof an extended asm.  So we only have to
worry about branches across the asm.

Gcc knows how many individual instructions are in an extended asm.  We count
the separators, which is usually a ';', though this is configurable.  Then we
multiply by the architecture defined default instruction size.  We can make
this an arbitrarily large value for extended asms if we want.  We could set
this to the size of the largest macro expansion, which would solve the general
case.  If we assume that asms are rare, then there should be very little
performance loss from this over general assumption.

It has always been the case that extended asms are a hook to gcc internals
which work only if you know how gcc internals work.  So we could perhaps try
to define away the problem by saying that extended asms that use macro
instructions are no longer supported.  Some people might not like that,
but if we explain that it is necessary to improve gcc performance then
perhaps they will understand.

Worst case, we change the extended asm syntax so that people can specify the
worst case size of them.  I'd rather not do that though.

Jim


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