On Mon, Nov 09, 2015 at 10:29:10AM -0600, Segher Boessenkool wrote: > On Sun, Nov 08, 2015 at 07:39:14PM -0500, Michael Meissner wrote: > > +;; Pretend we have a memory form of extswsli until register allocation is > > done > > +;; so that we use LWZ to load the value from memory, instead of LWA. > > We generate sign_extend loads for many cases where zero_extend would be > preferable. We should deal with that generically, and then we can lose > this hack.
Well it would be nice in theory. But since we don't have that generic pass, I need to use the combiner to generate the instruction. > > +(define_insn_and_split "*ashdi3_extswsli_dot" > > ... > > > + if (REGNO (cr) == CR0_REGNO) > > + { > > + emit_insn (gen_ashdi3_extswsli_dot2 (dest, src2, shift, cr)); > > + DONE; > > + } > > s/dot2/dot/ No, it will endless recurse until there is a stack overflow if you use dot (since it will call itself, generating the same pattern over and over again). > > +/* { dg-final { scan-assembler "extswsli\\. " } } */ > > +/* { dg-final { scan-assembler "lwz " } } */ > > +/* { dg-final { scan-assembler-not "lwa " } } */ > > "lwa" is a nasty string to search for ("always"). You can write this as > {\mlwa\M} for more sanity. > > > +/* { dg-final { scan-assembler-not "sldi " } } */ > > +/* { dg-final { scan-assembler-not "sldi\\. " } } */ > > Similarly {\msldi\M} catches both. Thanks. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797