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: Mark Mitchell <mark at codesourcery dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Aug 2007 23:04:15 +0100
- Subject: Re: Arch-independent double-word clz expansion and a few other tweaks for bitscanning
- References: <46BD5B0D.403@codesourcery.com>
Zack Weinberg wrote:
> * optabs.c: Remove unnecessary forward declarations.
> (expand_unop_direct): New, broken out of expand_unop.
> (expand_doubleword_clz): New.
> (expand_ctz): Move above expand_ffs. Use
> start_sequence, end_sequence, add_equal_note, and
> expand_unop_direct. Add more commentary.
> (expand_ffs): Try both ctz optab and expand_ctz.
> Generate a test and branch if the hardware doesn't give us
> a useful value for input zero. Style improvements similar to
> expand_ctz.
>
> * config/arm/arm.md (ffssi2, ctzsi2): Delete.
> * config/i386/i386.h (CLZ_DEFINED_VALUE_AT_ZERO): Define.
> * config/i386/i386.md (ffssi2, ffs_cmove, *ffs_no_cmove)
> (*ffssi_1, ffsdi2, *ffsdi_1): Delete.
> (*ctzsi2_ccz, *bsr_ccz, *ctzdi2_ccz, *bsr_rex64_ccz)
> (*bsrhi_ccz): New insns.
> (ctzdi2): Move next to clzdi2.
This is OK.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713