This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] teach emit_store_flag to use clz/ctz
- From: Richard Henderson <rth at redhat dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org, amodra at gmail dot com
- Date: Thu, 03 May 2012 08:16:16 -0700
- Subject: Re: [PATCH] teach emit_store_flag to use clz/ctz
- References: <1335520129-28934-1-git-send-email-bonzini@gnu.org> <Pine.LNX.4.64.1204271308530.23071@jbgna.fhfr.qr> <4F9A948A.1040903@gnu.org> <CAFiYyc20Cqah92yxsk8CNNpE=w4yWB6bC_b1E=y9ryf-_33TGA@mail.gmail.com> <4FA25C86.5080800@gnu.org>
On 05/03/2012 03:23 AM, Paolo Bonzini wrote:
- ctzsi4 expands to bitrev + clz:SI, so it will return 32 too. ctz:SI
will never appear at all in the RTX stream, so you can define its value
at zero to be whatever you want. Hence the correct valid of
CTZ_DEFINED_VALUE_AT_ZERO is also 2.
That's for armv6. For armv5 we don't have bitrev, so we use 31-clz,
which yields a value at 0 of -1. Here I think it's best to mirror
the rs6000 port in that CLZ_DVAZ == 2, but CTZ_DVAZ == 1.
Similar reasoning applies basically everywhere.
One really needs to examine these closely, one by one.
r~