On Mon, Oct 24, 2016 at 01:20:09PM +0200, Eric Botcazou wrote:
> > You can use SO instead, but then you have to make sure it is clear before
> > you run the OE=1 instruction.  SO of course is the cheapest way to access
> > overflow (it is copied to the CR field on any compare or recording insn).
> 
> Is there an efficient way of clearing the XER then?  Because this kind of 
> sticky flag is not usable with the current infrastructure.

mtxer, maybe together with mfxer if you care about the other bits in there.
Efficient?  Nope.

Maybe the best you can do is generate the double-width result, and then
check if the upper halve is the sign extension of the lower halve.  Maybe
some trickery can help (for add/sub/neg at least).

You can also just FAIL the expander if !TARGET_MCRXR.  I wonder just how
bad the generic code is.

> > How so?  It behaves exactly like CA, i.e. exactly like a register (it _is_
> > a register!)
> 
> You can do arithmetical operations with CA by means of the extended form 
> whereas you cannot with OV, you really need to manipulate it like a flag.

Yes, you cannot cheaply read from it :-(  That doesn't matter for how we
model it in GCC though.  We cannot cheaply read from CA either.


Segher

Reply via email to