On Thu, Dec 06, 2001 at 08:40:29PM +1100, Bruce Evans wrote:
>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.

To quote the "Extended Asm" section of the GCC info file:
"   If your assembler instruction can alter the condition code register,
 add `cc' to the list of clobbered registers.  GNU CC on some machines
 represents the condition codes as a specific hardware register; `cc'
 serves to name this register.  On other machines, the condition code is
 handled differently, and specifying `cc' has no effect.  But it is
 valid no matter what the machine."

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

My understanding (from the above quote) is that "cc" is a generic virtual
register used to represent a processor's condition codes - independent of
how the processor actually implements conditions.  "eflags" is the physical
i386 register containing the condition codes (amongst other things).

>That gives a hint about where to look for the clobbering conventions.  From
>Application asms are apparently in the "All else" set.

This appears to come down to a case of the generic documentation requiring
"cc" clobbers, whereas the current implementation on the i386 doesn't.

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

Good point.  There seem to be 3 options:

1a) Modify notice_update_cc() to recognize the RTL associated with
    mov[sdx]f_push and clobber the condition codes in that case.  This
    is the approach I suggested in the PR.
1b) Modify the mov[sdx]f_push templates in i386.md to do a CC_STATUS_INIT.
    I have implemented this and it seems to work.  I'll post it into
    the PR at some stage.
2) Modify the mov[sdx]f_push templates in i386.md to use leal ISO subl.
   This is probably the best option since it will preserve the condition
   code.  Unfortunately, I'm not sure how to define an RTX for "-4(%esp)",
   a quick rummage suggests adj_offsettable_operand(), but that doesn't
   allow negative offsets.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to