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, middle-end] Improve num_sign_bit_copies when ANDing with a const


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


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