This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, middle-end] Improve num_sign_bit_copies when ANDing with a const
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Adam Nemet <anemet at caviumnetworks dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Jun 2007 12:51:41 -0400
- Subject: Re: [PATCH, middle-end] Improve num_sign_bit_copies when ANDing with a const
- References: <18048.37503.670427.159838@localhost.localdomain>
Adam Nemet wrote:
> For AND and IOR, num_sign_bit_copies returns the minimum number of
> sign-bit copies of its operands. We can do better when these are used
> to clear or set high order bits.
>
> Tested on mipsisa64-elf, boostrapped and tested on x86_64-linux.
>
> OK after the lockdown?
> * rtlanal.c (num_sign_bit_copies1) <AND, IOR>: Improve cases
> of ANDing or IORing with a constant.
OK.
(It's lame that there are HOST_WIDE_INT checks in this code; clearly,
the host configuration has no impact on the validity of this
optimization. But, I know the whole function is like this, so what
you're doing is in keeping with that.)
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713