On Mon, Nov 09, 2015 at 09:59:43AM -0600, Segher Boessenkool wrote: > On Sun, Nov 08, 2015 at 07:37:53PM -0500, Michael Meissner wrote: > > This patch adds support for scalar count trailing zeros instruction that is > > being added to ISA 3.0 (power9). > > I bet you should change CTZ_DEFINED_VALUE_AT_ZERO as well. > > > +(define_insn "ctz<mode>2_hw" > > + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") > > + (ctz:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] > > + "TARGET_CTZ" > > + "cnttz<wd> %0,%1" > > + [(set_attr "type" "cntlz")]) > > We should probably rename this attr value now. "cntz" maybe? Could be > later of course.
I don't see a need to add another type attribute for count trailing zeros unless count leading zeros has a different timing than count trailing zeros. The cntlz attribute was added because in Power7 the CNTLZ instruction became a 2 cycle instruction, and we wanted to model this in power7.md (and hence cntlz was split from the simple integer attribute). -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797