This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: inline asm and status flags on x86


On Tue, May 02, 2000 at 01:01:43PM -0400, Geoff Berry wrote:
> Is there any way to specify that an asm statement reads the values of the
> status flags on the x86?

No.

> The reason I'm trying to express "cc" as being read by the asm statement is
> so that the statement previous to the asm statement will produce flags.

Things don't work that way.  We don't look for readers and then generate
setters; instead we generate setters (comparisons) and readers (branches).
We may, along the way, decide that a comparison is redundant with a 
previous operation (some arithmetic), or that a branch can be transformed
into a setcc or movcc operation.

Otherwise we do not recognize that any particular operation produces a
meaningful value in the flags.  This gives us the freedom to choose lea
vs addl vs incl, all of which affect the flags differently.


r~

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