[PATCH, i386]: Emit cld instruction when stringops are used

Jan Hubicka hubicka@ucw.cz
Thu Mar 6 23:58:00 GMT 2008


> 
> Due to this, IMO there is no point to implement cld inserting via LCM 
> (this would require major work, since we will have to restore REG_DIR 
> fake register in order to make _all_ stringop patterns consumers of this 
> register). There is also no point to trigger cld insertion with inline 
> asm, as this will fix a non-bug.
> 
> IMO, -mcld should be off by default. This flag should provide a way to 
> still compile the code that is now _known_ to be buggy. But it is up to 
> distributions to decide if they want to penalize applications with 
> unnecessary cld instructions. I expect that the need for -mcld will 
> phase out relatively quickly.

Lets hope so.  I fully agree with plan of having -mcld option with
default being off (though I do se just relatively limited usability for
it and don't see it as reason for very fast release of next
4.3.something). For this use current prologue patch is least intrusive
variant.

For performance critical applications it can mean some degradation
relative to previous GCCs by doing CLDs in functions that return before
getting to execute stringop, but those probably want to run on fixed
kernel and not pay for CLD penalty at all.

BTW I tried to revert the CLD removal patch and apply LCM variant on top
of it and it is doable with some fixup, but more intrusive than what we
want to do on release branch.

Honza



More information about the Gcc-patches mailing list