This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH], Add power9 support to GCC, patch #4
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org, dje dot gcc at gmail dot com
- Date: Mon, 9 Nov 2015 12:27:34 -0500
- Subject: Re: [PATCH], Add power9 support to GCC, patch #4
- Authentication-results: sourceware.org; auth=none
- References: <20151103202911 dot GA5304 at ibm-tiger dot the-meissners dot org> <20151109003914 dot GD17170 at ibm-tiger dot the-meissners dot org> <20151109162910 dot GA9602 at gate dot crashing dot org>
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: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797