public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] x86-64: Use R10 and R11 for profiling large model with PIC
Date: Fri, 8 Jan 2021 15:31:13 +0100	[thread overview]
Message-ID: <CAFULd4bWBQebLASq7OE+R9C9Rq0x1nJCO1L02=gOC16xniMJsA@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOrcKaGvYsvm3kQi8OP2vRmkcsTasks+otnxtNJJVgt8GA@mail.gmail.com>

On Fri, Jan 8, 2021 at 2:28 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Jan 8, 2021 at 4:50 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Fri, Jan 8, 2021 at 1:24 AM Uros Bizjak <ubizjak@gmail.com> wrote:
> > >
> > > > Since R10 is preserved when calling mcount, R10 can be used a scratch
> > > > register to call mcount in large model.
> > >
> > > Please mention that R10 can be used as a static chain registers and is
> > > preserved when calling mcount for nested functions.
> > >
> > > > gcc/
> > > >
> > > > PR target/98482
> > > > * config/i386/i386.c (x86_function_profiler): Use R10 to call
> > > > mcount in large model. Sorry for large model with PIC.
> > > >
> > > > gcc/testsuite/
> > > >
> > > > PR target/98482
> > > > * gcc.target/i386/pr98482-1.c: New test.
> > > > * gcc.target/i386/pr98482-1.c: Likewise.
> > >
> > > OK with comment fixes.
> > >
> > > Thanks,
> > > Uros.
> > >
> > > +    case CM_LARGE:
> > > +      /* NB: R10 can be used as a scratch register here since
> > > +        R10 is preserved when calling mcount.  */
> > >
> > > Also mention that R10 can be used as a static chain register and is
> > > preserved when calling mcount for nested functions.
> > >
> > > +      fprintf (file, "1:\tmovabsq\t$%s, %%r10\n\tcall\t*%%r10\n",
> > > +       mcount_name);
> > > +      break;
> >
> > This is the patch I am checking in.
> >
>
> For NO_PROFILE_COUNTERS targets, R11 is a scratch register.  We can use
> R10 and R11 to call mcount in large model with PIC.
>
> OK for master?

+          fprintf (file, "\tmovabsq\t$%s@PLTOFF, %%r11\n",
+               mcount_name);

Please put mcount_name in the same line (and please do the same for
case CM_MEDIUM_PIC).

OK with the above fixes.

Thanks,
Uros.

  reply	other threads:[~2021-01-08 14:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  9:24 [PATCH] x86-64: Use R10 for profiling large model Uros Bizjak
2021-01-08 12:50 ` H.J. Lu
2021-01-08 13:27   ` [PATCH] x86-64: Use R10 and R11 for profiling large model with PIC H.J. Lu
2021-01-08 14:31     ` Uros Bizjak [this message]
2021-01-08 14:43       ` H.J. Lu
2021-01-08 16:45         ` [PATCH] x86-64: Require lp64 for PR target/98482 tests H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFULd4bWBQebLASq7OE+R9C9Rq0x1nJCO1L02=gOC16xniMJsA@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).