[PATCH], Add power9 support to GCC, patch #4

Segher Boessenkool segher@kernel.crashing.org
Mon Nov 9 16:29:00 GMT 2015


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.

> +(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/

> +/* { 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.


Segher



More information about the Gcc-patches mailing list