From: Xi Ruoyao <xry111@xry111.site>
To: Rui Wang <wangrui@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH] LoongArch: Improve memory ops
Date: Mon, 10 Apr 2023 22:36:26 +0800 [thread overview]
Message-ID: <8aeb6d8dc4cbe8c992b69d75d8953d59b71a2c38.camel@xry111.site> (raw)
In-Reply-To: <CAHirt9ib2LPXMbxb+UCJB1MsBnUuWNLb5+uyqcR5Wiw2fsJi6w@mail.gmail.com>
On Mon, 2023-04-10 at 22:22 +0800, Rui Wang wrote:
> On Mon, Apr 10, 2023 at 8:54 PM Xi Ruoyao <xry111@xry111.site> wrote:
> > Regarding these functions: we have -ffreestanding which is
> > preventing
> > the compiler from optimizing for e.g. "memcpy(a, b, 8);" into a
> > simple
> > ld.d/st.d pair. A explicit compiler built-in usage like
> >
> > #define memcpy(a, b, c) __builtin_memcpy(a, b, c)
> >
> > would allow the compiler to do such kind of optimization. Will
> > this
> > improve the performance?
>
> That's a good question. IIUC, the current compiler generates
> inefficient code for constant-length memcpy, which may sacrifice
> performance for compatibility, as not all hardware supports unaligned
> memory access. We need a runtime CPU feature dispatch mechanism
> similar to alternatives to improve the compiler. This is indeed a
> problem that needs to be addressed.
Hmm, yep, GCC does not take the advantage of -mstrict-align expanding
memcpy etc. I'll add it into my TODO list for GCC 14.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2023-04-10 14:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-10 11:57 WANG rui
2023-04-10 12:20 ` Xi Ruoyao
2023-04-10 14:19 ` Rui Wang
2023-04-10 14:37 ` Xi Ruoyao
2023-04-10 15:53 ` WANG Rui
2023-04-10 12:53 ` Xi Ruoyao
2023-04-10 14:22 ` Rui Wang
2023-04-10 14:36 ` Xi Ruoyao [this message]
2023-04-10 15:52 ` WANG Rui
2023-04-11 6:21 ` 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=8aeb6d8dc4cbe8c992b69d75d8953d59b71a2c38.camel@xry111.site \
--to=xry111@xry111.site \
--cc=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=wangrui@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
all inboxes | Powered by JetHome®