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] Optimize nested SIGN_EXTENDs/ZERO_EXTENDs (PR target/45336)


On Thu, Aug 19, 2010 at 07:23:24PM +0200, Bernd Schmidt wrote:
> On 08/19/2010 06:33 PM, Jakub Jelinek wrote:
> > +      /* (sign_extend:M (ashirtrt:O (ashift <X> (const_int N)) (const_int N)))
> > +	 is (sign_extend:M (subreg:P <X>)) if there is mode with
> > +	 GET_MODE_BITSIZE (O) - N bits.  */
> 
> Why not do the same with zero_extend and lshiftrt?  Otherwise ok.

ZERO_EXTEND is expanded into AND instead of LSHIFTRT/ASHIFT by combine, and
two nested ANDs should be easily optimized.  If you really want, I can
handle the ZERO_EXTEND (AND <X> mask) case as a follow-up.

	Jakub


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