Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2001 20:40:29 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        <current@FreeBSD.org>
Subject:   Re: Patch Review: i386 asm cleanups in the kernel
Message-ID:  <20011206201803.Q14784-100000@gamplex.bde.org>
In-Reply-To: <XFMail.011205155406.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 5 Dec 2001, John Baldwin wrote:

> On 05-Dec-01 Bruce Evans wrote:
> >> - Add missing "cc" clobbers in constraints
> >
> > Does this have any effect (for i386's) except to create a lot of clutter
> > Even i386.md doesn't use it.  gcc.info says:
> > ...
> > None of i386.md, alpha.md or sparc.md do this.  i386's and alphas have a
> > cc0 register, but it is only mentioned for instructsions whose main (only?)
> > effect is to to set the condition codes.
>
> Hmm, so how does one clobber "eflags" if "cc" isn't "eflags"?

Neither seems to be in gcc/config/i386/i386.h.  I think "cc" is generic, so
using it in clobber lists is not wrong.

> Look at PR
> gnu/32365 which seems to indicate that "cc" does, in fact, represent "eflags"
> in the clobber list.

That gives a hint about where to look for the clobbering conventions.  From
gcc/config/i386/i386.c:

! /* Set the cc_status for the results of an insn whose pattern is EXP.
!    On the 80386, we assume that only test and compare insns, as well
!    as SI, HI, & DI mode ADD, SUB, NEG, AND, IOR, XOR, BSF, ASHIFT,
!    ASHIFTRT, and LSHIFTRT instructions set the condition codes usefully.
!    Also, we assume that jumps, moves and sCOND don't affect the condition
!    codes.  All else clobbers the condition codes, by assumption.
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
!
!    We assume that ALL integer add, minus, etc. instructions effect the
!    condition codes.  This MUST be consistent with i386.md.
!
!    We don't record any float test or compare - the redundant test &
!    compare check in final.c does not handle stack-like regs correctly. */
!
! void
! notice_update_cc (exp)
!      rtx exp;

Application asms are apparently in the "All else" set.

The bug in the PR could probably be fixed without updating this function
by using leal instead of addl to adjust the stack.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011206201803.Q14784-100000>