This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inline asm and status flags on x86
- To: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: inline asm and status flags on x86
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 04 May 2000 19:08:05 +0100
- Cc: Geoff Berry <geoffb at bops dot com>, law at cygnus dot com, gcc at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
> On Thu, May 04, 2000 at 01:42:31PM -0400, Geoff Berry wrote:
> > How's this?
> >
> > 2000-05-04 Geoff Berry <geoffb@bops.com>
> >
> > * extend.texi (Extended Asm): Document inability to give asm
> > statements access to condition codes.
> >
> > Index: extend.texi
> > ===================================================================
> > RCS file: /cvs/gcc/egcs/gcc/extend.texi,v
> > retrieving revision 1.44
> > diff -c -3 -p -r1.44 extend.texi
> > *** extend.texi 2000/03/14 08:24:21 1.44
> > --- extend.texi 2000/05/04 17:39:52
> > *************** instructions would alter the condition c
> > *** 2662,2667 ****
> > --- 2662,2671 ----
> > test it. This problem doesn't arise for ordinary ``test'' and
> > ``compare'' instructions because they don't have any output operands.
> >
> > + For reasons similar to those described above, it is not possible to give
> > + an assembler instruction access to the condition code left by previous
> > + instructions.
> > +
> > If you are writing a header file that should be includable in ANSI C
> > programs, write @code{__asm__} instead of @code{asm}. @xref{Alternate
> > Keywords}.
>
> We probably should at least think about redoing the wording of previous
> paragraph for non-CC0 machines.
>
I don't see how you would do it even for non-CC0 machines. The inputs to
an ASM are 'C' (or other language) variables, or expressions. There are
no expressions that directly represent the state of the condition-codes at
this level, so there is no way to specify to the ASM what was intended.
R.