On 09/02/2015 03:00 PM, Segher Boessenkool wrote:
On Wed, Sep 02, 2015 at 01:59:58PM -0600, Jeff Law wrote:
(set (reg:CC 66 cc)
     (compare:CC (and:DI (lshiftrt:DI (subreg:DI (reg/v:SI 76 [ xD.2641 ])
     0)
                 (const_int 1 [0x1]))
             (const_int 1 [0x1]))
         (const_int 0 [0])))
Yea, this is an alternative form.   I don't offhand remember how/why
this form appears, but it certainly does.  I don't think any ports
handle this form (but I certainly have done any checks), but I believe
combine creates it primarily for internal purposes.

Combine replaces zero_ext* with equivalent shift/and patterns and tries
again, if things don't match.  Targets with more generic masking insns
do not want to describe the very many cases that can be described with
zero_ext* separately.

rs6000 handles this exact pattern, btw.  And I'll be very happy if we can
just drop it :-)
If I still cared, I'd probably look into this for the PA which has some rough similarities with the PPC architecture in its bit insertion/extraction capabilities. But the PA just isn't worth the time :-)

cindex @code{zero_extract}, canonicalization of
@cindex @code{sign_extract}, canonicalization of
@item
Equality comparisons of a group of bits (usually a single bit) with zero
will be written using @code{zero_extract} rather than the equivalent
@code{and} or @code{sign_extract} operations.

Oh it's even documented, thanks.  I do still think we should think of
changing this.
Do-able, but I suspect the fallout would be significant across the older ports.

Jeff

Reply via email to