From: Xi Ruoyao <xry111@xry111.site>
To: Lulu Cheng <chenglulu@loongson.cn>, gcc-patches@gcc.gnu.org
Cc: Chenghua Xu <xuchenghua@loongson.cn>, Wang Xuerui <i@xen0n.name>
Subject: Re: [PATCH 0/2] loongarch: improve code generation for integer division
Date: Sun, 10 Jul 2022 11:44:02 +0800 [thread overview]
Message-ID: <bc44e75c8a8ba6b2c9e2cfeda080d56029669507.camel@xry111.site> (raw)
In-Reply-To: <a5f7c00d-55d5-9c0e-52f1-fc471d4f5cba@loongson.cn>
On Sun, 2022-07-10 at 10:20 +0800, Lulu Cheng wrote:
>
> 在 2022/7/7 上午10:23, Xi Ruoyao 写道:
> > We were generating some unnecessary instructions for integer
> > division.
> > These two patches improve the code generation to compile
> >
> > template <class T> T div(T a, T b) { return a / b; }
> >
> > into a single division instruction (along with a return instruction
> > of
> > course) as we expected for T in {int32_t, uint32_t, int64_t}.
> >
> > Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk?
> >
> > Xi Ruoyao (2):
> > loongarch: add alternatives for idiv insns to improve code
> > generation
> > loongarch: avoid unnecessary sign-extend after 32-bit division
> >
> > gcc/config/loongarch/loongarch-protos.h | 1 +
> > gcc/config/loongarch/loongarch.cc | 2 +-
> > gcc/config/loongarch/loongarch.md | 34 ++++++++++++++++--
> > ----
> > gcc/testsuite/gcc.target/loongarch/div-1.c | 9 ++++++
> > gcc/testsuite/gcc.target/loongarch/div-2.c | 9 ++++++
> > gcc/testsuite/gcc.target/loongarch/div-3.c | 9 ++++++
> > gcc/testsuite/gcc.target/loongarch/div-4.c | 9 ++++++
> > 7 files changed, 63 insertions(+), 10 deletions(-)
> > create mode 100644 gcc/testsuite/gcc.target/loongarch/div-1.c
> > create mode 100644 gcc/testsuite/gcc.target/loongarch/div-2.c
> > create mode 100644 gcc/testsuite/gcc.target/loongarch/div-3.c
> > create mode 100644 gcc/testsuite/gcc.target/loongarch/div-4.c
> >
> LGTM and spec has been tested.
>
> Thanks!
Pushed r13-1592 and r13-1593.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
prev parent reply other threads:[~2022-07-10 3:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 2:23 Xi Ruoyao
2022-07-07 2:26 ` [PATCH 1/2] loongarch: add alternatives for idiv insns to improve code generation Xi Ruoyao
2022-07-07 2:29 ` [PATCH 2/2] loongarch: avoid unnecessary sign-extend after 32-bit division Xi Ruoyao
2022-07-08 1:23 ` [PATCH 0/2] loongarch: improve code generation for integer division Lulu Cheng
2022-07-10 2:20 ` Lulu Cheng
2022-07-10 3:44 ` Xi Ruoyao [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=bc44e75c8a8ba6b2c9e2cfeda080d56029669507.camel@xry111.site \
--to=xry111@xry111.site \
--cc=chenglulu@loongson.cn \
--cc=gcc-patches@gcc.gnu.org \
--cc=i@xen0n.name \
--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).