[PATCH] bitops: remove condition code clobber for CLZ

Nicolas Pitre nico at fluxnic.net
Tue Jan 11 17:28:15 EST 2011


On Tue, 11 Jan 2011, Russell King - ARM Linux wrote:

> On Tue, Jan 11, 2011 at 01:51:19PM -0500, Nicolas Pitre wrote:
> > On Tue, 11 Jan 2011, Russell King - ARM Linux wrote:
> > 
> > > On Tue, Jan 11, 2011 at 11:12:05PM +0530, Rabin Vincent wrote:
> > > > The CLZ instruction does not alter the condition flags, so remove the
> > > > "cc" clobber from the inline asm for fls().
> > > 
> > > Do you have any evidence that this changes anything, or is it just
> > > subjective?
> > 
> > This probably doesn't change anything, as gcc has been presuming that 
> > inline asms do clobber the condition code for years now, in order to 
> > prevent issues caused by a lack of %? appended to instructions in order 
> > to conditionally execute them otherwise.  So this would only make the 
> > code self consistent.
> 
> So given that Linus complains about churn from ARM, what's the
> justification to apply a patch which has no effect what so ever?

Code self documentation.

If we know the inline asm is actually clobbering the condition code, 
then it makes sense to list cc in the clobber list.  And conversely as 
well, for the benefit of those reading that code.  Having cc in the 
clobber list for some inline asm that does not actually clobber the 
condition code is just confusing.


Nicolas



More information about the linux-arm-kernel mailing list