[PATCH] Optimize andl $0xffffffff, %eax

Paolo Bonzini bonzini@gnu.org
Sun May 24 11:58:00 GMT 2009


Jakub Jelinek wrote:
> On Thu, May 21, 2009 at 05:44:09PM +0200, Richard Guenther wrote:
>>> Bootstrapped/regtested on x86_64-linux, ok for trunk?
>> Hm, isn't that something simplify-rtx should do?  Transform
>> (and:SI reg 0xfffff) to (zero-extend:SI (subreg ...))?
> 
> I fear that's too risky, on most targets zero_extend?i?i2 is implemented
> using and, so if simplify-rtx canonicalizes that to zero-extend, we
> risk oscillating forever between the two.

Agreed.  If anything, maybe we could fold it on the tree level to (int)
(unsigned short) x.  There at least the oscillation would be target
independent...	

Paolo



More information about the Gcc-patches mailing list