This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH], Add power9 support to GCC, patch #3 (scalar count trailing zeros)
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org, dje dot gcc at gmail dot com
- Date: Mon, 9 Nov 2015 12:17:49 -0500
- Subject: Re: [PATCH], Add power9 support to GCC, patch #3 (scalar count trailing zeros)
- Authentication-results: sourceware.org; auth=none
- References: <20151103202911 dot GA5304 at ibm-tiger dot the-meissners dot org> <20151109003753 dot GC17170 at ibm-tiger dot the-meissners dot org> <20151109155942 dot GA8759 at gate dot crashing dot org>
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: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797