Subject: Re: [PATCH] atomic_dec_if_positive sign extension fix

From: Segher Boessenkool <[email-masked]>
Date: Tue, 16 Jan 2007 09:36:41 +0100

>> You can specify "cc" in the clobber list already, don't use
>> "xer" unless you're clobbering something else in the XER.
>>
>
> Hmm, I believed "cc" was an alias for cr0.

Yes it is and I'm just confused.  Sorry about that.
My excuse is that "addic." would do that to anyone ;-)

> /* PSImode is used for the XER register.  The XER register
>    is not used for anything; perhaps it should be deleted,
>    except that that would change register numbers.  */
> PARTIAL_INT_MODE (SI);
>
> in gcc/config/rs6000-modes.def is actually a bit misleading since the
> XER is often clobbered by instructions. But the XER is actually never
> exposed to the instruction scheduler: all the patterns that set and use
> the carry are simple lists of machine instructions which will be put in
> the final object without modifications (only register number and 
> possibly
> immediate value substitution).

Yes indeed.  Replacing the XER in GCC with a "carry register"
has been on my todo list for years; it is one of the last
things that still require emitting more than one machine insn
at once.

Segher