This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Arch-independent double-word clz expansion and a few other tweaks for bitscanning


On Sat, 11 Aug 2007, Rask Ingemann Lambertsen wrote:
> On Sat, Aug 11, 2007 at 07:05:25AM -0400, Hans-Peter Nilsson wrote:
> > On Sat, 11 Aug 2007, Rask Ingemann Lambertsen wrote:

(from combine.c:try_combine)
> #ifndef HAVE_cc0
>   /* Many machines that don't use CC0 have insns that can both perform an
>      arithmetic operation and set the condition code.  These operations will
>      be represented as a PARALLEL with the first element of the vector
>      being a COMPARE of an arithmetic operation with the constant zero.
> ...

Thanks.  Odd.  I'm quite sure the other order works too, but
perhaps it's just by accident.

>      The second element of the vector will set some pseudo to the result
>      of the same arithmetic operation.  If we simplify the COMPARE, we won't
>      match such a pattern and so will generate an extra insn.   Here we test
>      for this case, where both the comparison and the operation result are
>      needed, and make the PARALLEL by just replacing I2DEST in I3SRC with
>      I2SRC.  Later we will make the PARALLEL that contains I2.  */
>
> > If combine "wants it" that way (proof would be
> > helpful), there's reason to change it, to align with the order
> > where a clobber is last.
>
>    I too would prefer it the other way around to make it easier to
> copy/paste the patterns, but in many cases you also have a pattern where the
> clobber is on "operand" 0 [1], so it's not a big saving.

When clobbers are automatically added to insns when trying to
match them to patterns, they are appended, not prepended, so
there's the reason.

> [1] Because your expectation that "the reg:CCx setting is secondary" doesn't
> hold.

This "secondary" was referring to the purpose when seen as a
side-effect, not necessarily order, so it still holds, even if
order doesn't follow purpose at present. ;)

But let's just change it, if nobody (people or ports) disagrees.

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]