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: PATCH: ffs/ctz expansions using clz


Richard Sandiford wrote:
> Sandra Loosemore <sandra@codesourcery.com> writes:
>> This patch depends on CLZ_DEFINED_VALUE_AT_ZERO applying to the clz
>> optab as well as the clz rtl expression.  I couldn't tell from reading
>> the documentation whether this is a change from its previous meaning
>> or not, but I don't think it's inconsistent with current practice in
>> all the other back ends.
> 
> It is a change.  I was thinking the macro ought to be tristate:
> defined always, defined for the clz rtl code only, or undefined.
> Sorry for not making that clear.

All right.  Let's do the following for CLZ_DEFINED_VALUE_DEFINED_AT_ZERO:

0 - Not defined at zero.
1 - Defined at zero for the RTL "clz" instruction.
2 - Defined at zero for both the RTL "clz" instruction and the optabs
"clz" expansion.

That's backwards-compatible, as the existing definitions are all
{0,1}-valued.

Sandra, please adjust the documentation in tm.texi to reflect the
possible value "2" and your patch to test for that.  With those changes,
your patch is OK.

You will of course need to define the macro to "2" in the MIPS back end
to get the benefit of your patch.  Given Richard's comments, that change
is OK as well, unless he indicates otherwise.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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