This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize nested SIGN_EXTENDs/ZERO_EXTENDs (PR target/45336)
On 08/19/2010 07:32 PM, Jakub Jelinek wrote:
> 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.
Oh, in expand_compound_operation? I was thinking about finding such
shifts in a pair of insns (happens on Thumb). Also, what about callers
other than combine?
Bernd