This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Arch-independent double-word clz expansion and a few other tweaks for bitscanning
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- Cc: Zack Weinberg <zack at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 11 Aug 2007 07:05:25 -0400 (EDT)
- Subject: Re: Arch-independent double-word clz expansion and a few other tweaks for bitscanning
- References: <46BD5B0D.403@codesourcery.com> <20070811090549.GW25795@sygehus.dk>
On Sat, 11 Aug 2007, Rask Ingemann Lambertsen wrote:
> On Fri, Aug 10, 2007 at 11:45:33PM -0700, Zack Weinberg wrote:
> > +(define_insn "ctzsi2"
> > + [(set (match_operand:SI 0 "register_operand" "=r")
> > + (ctz:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))
> > + (set (reg:CCZ FLAGS_REG)
> > + (compare:CCZ (match_dup 1) (const_int 0)))]
>
> Usually this sort of insn has the (set (reg:CCx FLAGS_REG) ...) part
> first because that's how combine wants it. Likewise with the other ones you
> added.
That's not the way I remember it from my CC_REG experiments with
CRIS, and kind of unexpected as the reg:CCx setting is
secondary. 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. (Hoping to eventually emit both the
clobber and reg:CCx setting variant with a macro/iterator
pattern. And yes, I know that's not currently possible.)
brgds, H-P