public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: WANG Xuerui <i@xen0n.name>
To: Lulu Cheng <chenglulu@loongson.cn>, gcc-patches@gcc.gnu.org
Cc: xry111@xry111.site, xuchenghua@loongson.cn
Subject: Re: [PATCH] LoongArch: Modify fp_sp_offset and gp_sp_offset's calculation method, when frame->mask or frame->fmask is zero.
Date: Thu, 7 Jul 2022 16:31:10 +0800	[thread overview]
Message-ID: <d20aebf5-e3a7-e364-9aca-1c5f87fc3e52@xen0n.name> (raw)
In-Reply-To: <20220707080428.2236776-1-chenglulu@loongson.cn>

Hi,

On 2022/7/7 16:04, Lulu Cheng wrote:
> gcc/ChangeLog:
>
> 	* config/loongarch/loongarch.cc (loongarch_compute_frame_info):
> 	Modify fp_sp_offset and gp_sp_offset's calculation method,
> 	when frame->mask or frame->fmask is zero, don't minus UNITS_PER_WORD
> 	or UNITS_PER_FP_REG.
IMO it's better to also state which problem this change is meant to 
solve (i.e. your intent), better yet, with an appropriate bugzilla link.
> ---
>   gcc/config/loongarch/loongarch.cc | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
> index d72b256df51..5c9a33c14f7 100644
> --- a/gcc/config/loongarch/loongarch.cc
> +++ b/gcc/config/loongarch/loongarch.cc
> @@ -917,8 +917,12 @@ loongarch_compute_frame_info (void)
>     frame->frame_pointer_offset = offset;
>     /* Next are the callee-saved FPRs.  */
>     if (frame->fmask)
> -    offset += LARCH_STACK_ALIGN (num_f_saved * UNITS_PER_FP_REG);
> -  frame->fp_sp_offset = offset - UNITS_PER_FP_REG;
> +    {
> +      offset += LARCH_STACK_ALIGN (num_f_saved * UNITS_PER_FP_REG);
> +      frame->fp_sp_offset = offset - UNITS_PER_FP_REG;
> +    }
> +  else
> +    frame->fp_sp_offset = offset;
>     /* Next are the callee-saved GPRs.  */
>     if (frame->mask)
>       {
> @@ -931,8 +935,10 @@ loongarch_compute_frame_info (void)
>   	frame->save_libcall_adjustment = x_save_size;
>   
>         offset += x_save_size;
> +      frame->gp_sp_offset = offset - UNITS_PER_WORD;
>       }
> -  frame->gp_sp_offset = offset - UNITS_PER_WORD;
> +  else
> +    frame->gp_sp_offset = offset;
>     /* The hard frame pointer points above the callee-saved GPRs.  */
>     frame->hard_frame_pointer_offset = offset;
>     /* Above the hard frame pointer is the callee-allocated varags save area.  */

  reply	other threads:[~2022-07-07  8:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  8:04 Lulu Cheng
2022-07-07  8:31 ` WANG Xuerui [this message]
2022-07-07  8:58   ` Xi Ruoyao

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=d20aebf5-e3a7-e364-9aca-1c5f87fc3e52@xen0n.name \
    --to=i@xen0n.name \
    --cc=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /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).