lkml.org 
[lkml]   [2005]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
On Sat, Sep 17, 2005 at 12:18:22AM -0700, David S. Miller wrote:
> > My biggest problem here is the lack of gcc support to get the
> > condition code out of an asm.
>
> I agree, this is the biggest deficiency in gcc inline assembly and I
> run into it all the time.

gcc did have some support to pass condition codes into assembly.
On ARM, you used to be able to do things like:

if (foo)
asm("blah%? whatever");

and gcc would replace %? with whatever condition was appropriate
for the current block of code. You can still write it as the
above.

However, this optimisation was disabled on ARM apparantly because
it was very hard to for people to get correct - if you forgot the
%?, you need to add a "cc" clobber, and if you forget that as well
you might get unconditional behaviour.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-17 09:30    [W:0.106 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site