public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Chen Gang <chengang@emindsoft.com.cn>
Cc: rth@redhat.com, mikestump@comcast.net, gcc-patches@gcc.gnu.org,
	       cmetcalf@ezchip.com, walt@tilera.com,
	peter.maydell@linaro.org,
	       Chen Gang <gang.chen.5i5j@gmail.com>
Subject: Re: [PATCH v3] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount
Date: Wed, 19 Oct 2016 22:42:00 -0000	[thread overview]
Message-ID: <6cafbf03-21ed-059c-4c4a-e9429ab3ad97@redhat.com> (raw)
In-Reply-To: <57F6573F.5010003@emindsoft.com.cn>

On 10/06/2016 07:53 AM, Chen Gang wrote:
> Hello Maintainers:
>
> Is this patch OK? Please help check it when you have time (at least for
> me, it passes all related test and comparation).
>
> And I shall continue to find and fix another issues about tilegx.
>
> Thanks.
>
> On 6/4/16 21:25, chengang@emindsoft.com.cn wrote:
>> From: Chen Gang <gang.chen.5i5j@gmail.com>
>>
>> r10 may also be as parameter stack pointer for the nested function, so
>> need save it before call mcount.
>>
>> Also clean up code: use '!' instead of "== 0" for checking
>> static_chain_decl and compute_total_frame_size.
>>
>> 2016-06-04  Chen Gang  <gang.chen.5i5j@gmail.com>
>>
>> 	gcc/
>> 	PR target/71331
>> 	* config/tilegx/tilegx.c (tilegx_function_profiler): Save r10
>> 	to stack before call mcount.
>> 	(tilegx_can_use_return_insn_p): Clean up code.
So if I understand the tilegx architecture correctly, you're issuing the 
r10 save & sp adjustment as a bundle, and the restore & sp adjustment as 
a bundle.

The problem is the semantics of bunding on the tilegx effectively mean 
that all source operands are read in parallel, then all outputs occur in 
parallel.

So if we take the bundle

{addi sp,sp,-8 ; st sp, r10}

The address used for the st is the value of the stack pointer before the 
addi instruction.

Similarly for the restore r10 bundle.  The address used for the load is 
sp before adjustment.

Given my understanding of the tilegx bundling semantics, that seems wrong.

Jeff

  reply	other threads:[~2016-10-19 22:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-04 13:26 chengang
2016-10-06 13:45 ` Chen Gang
2016-10-19 22:42   ` Jeff Law [this message]
2016-10-21 22:16     ` Chen Gang
2016-10-22 22:59       ` Chris Metcalf
2016-10-23 18:11 Bernd Edlinger
2016-10-24 15:28 ` Jeff Law
2016-10-29  4:26   ` Chen Gang

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=6cafbf03-21ed-059c-4c4a-e9429ab3ad97@redhat.com \
    --to=law@redhat.com \
    --cc=chengang@emindsoft.com.cn \
    --cc=cmetcalf@ezchip.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=peter.maydell@linaro.org \
    --cc=rth@redhat.com \
    --cc=walt@tilera.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).