public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Lulu Cheng <chenglulu@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, gcc-patches@gcc.gnu.org
Cc: WANG Xuerui <i@xen0n.name>, Chenghua Xu <xuchenghua@loongson.cn>
Subject: Re: [GCC14 PATCH] LoongArch: Optimize additions with immediates
Date: Tue, 4 Apr 2023 17:15:16 +0800	[thread overview]
Message-ID: <4b87d686-9add-5355-d778-eaf87c86df0c@loongson.cn> (raw)
In-Reply-To: <fb3c492053fc61aa0e2a3af9b578ac8c75e44a13.camel@xry111.site>


在 2023/4/4 下午4:40, Xi Ruoyao 写道:
> On Tue, 2023-04-04 at 16:00 +0800, Xi Ruoyao via Gcc-patches wrote:
>> On Tue, 2023-04-04 at 11:01 +0800, Lulu Cheng wrote:
>>
>> /* snip */
>>
>>>> +unsigned long f10 (unsigned long x) { return x - 0x80000000l * 2; }
>>>> +unsigned long f11 (unsigned long x) { return x - 0x80000000l * 2; }
>>>   These two test cases are duplicates.
>> /* snip */
>>
>>>> +unsigned int g10 (unsigned int x) { return x - 0x80000000l * 2; }
>>>> +unsigned int g11 (unsigned int x) { return x - 0x80000000l * 2; }
>>> Ditto.
>> I'll fix them in V2.
>>
>>> I found that adding this log test case gcc.target/loongarch/stack-check-cfa-1.c and gcc.target/loongarch/stack-check-cfa-2.c test failed.
>>> Although the test fails, the generated assembly code is better, and there is no problem with the logic of the assembly code. I haven't checked the reason for this yet.
>> Looks like the change hides PR109035 (like -fpie) for some reason. (But
>> I still don't understand the root cause of PR109035 anyway.)
> V2 sent with test cases fixed.
>
> /* snip */
>
>> Technically there should be "addu16i.d $r3,$r3,-1" in the prologue and
>> "addu16i.d $r3,$r3,2" in the epilogue, so we can avoid using r14/r13.
>> I'll try modifying loongarch_expand_{pro,epi}logue for this.
> Will do this later because I'm too stupid to understand
> loongarch_first_stack_step function quickly :).
>
Thank you very much!


      reply	other threads:[~2023-04-04  9:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-02 14:00 Xi Ruoyao
2023-04-04  3:01 ` Lulu Cheng
2023-04-04  8:00   ` Xi Ruoyao
2023-04-04  8:40     ` Xi Ruoyao
2023-04-04  9:15       ` Lulu Cheng [this message]

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=4b87d686-9add-5355-d778-eaf87c86df0c@loongson.cn \
    --to=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --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).