This is the mail archive of the binutils@sourceware.org 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: Scheduling x86 dispatch windows


On Mon, Jun 14, 2010 at 03:14:37PM +0200, Michael Matz wrote:
> Doing the change in GNU as has the advantage that all insn lengths are 
> available without any work, i.e. it will handle e.g. inline asm; and that 
> relaxation also is implemented just fine (it exists already in order to 
> decide which jump form it's going to use); it has a high chance of always 
> emitting the correct sequences.  It has the disadvantage that GNU as would 
> emit (no-op) prefixes that the asm author didn't write.
> 
> Doing the change in GCC has the advantage that it would know about this 
> change in instruction size (and therefore also could calculate sizes of 
> jumps more correctly).  It has at least the disadvantage to need to do the 
> tedious job of ensuring all insn lengths are correct, which by necessicity 
> won't be done for inline asm; even ignoring inline asm it's known to 
> quickly bit-rot (despite Jakubs heroic efforts).  From that follows that 
> it has a somewhat higher chance of emitting slow sequences.
> 
> I don't see realistic and desirable other options.  For completeness 
> considerations (inline asm) I think changing GNU as is the better choice.

Doing it in GNU as without the user asking for it might break code though
(e.g. when code has jmp .+16 or something similar).
So, IMHO it is to be done in GNU as, it should be only requested through
directives.  Say directives that set start and end of an insn block which
would request padding the whole block to certain alignment and CPU to
optimize for while doing that.  This wouldn't be useful just for this future AMD
CPU, but e.g. could insert a prefix or two here and there to ensure loop
start is already aligned at 16 byte (or some other) boundary without having
to add a nop there.  Of course when optimizing for some CPUs the strategy
could be not to include any prefixes in the sequence, just add normal
aligning nop at the end.

	Jakub


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