On 04/20/2011 09:09 AM, Jakub Jelinek wrote: > Hi! > > This splitter allows us to optimize (x {* {2,4,8},<< {1,2,3}}) {|,^} y > for constant integer y <= {1ULL,3ULL,7ULL} using lea{l,q} (| or ^ in > that case, when the low bits are known to be all 0, is like plus). > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2011-04-20 Jakub Jelinek <ja...@redhat.com> > > PR target/48688 > * config/i386/i386.md (*lea_general_4): New define_insn_and_split.
Any chance you could do this in combine instead? Shift-and-add patterns are a fairly common architectural feature... r~