From: Lulu Cheng <chenglulu@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, 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: Fri, 8 Jul 2022 09:23:12 +0800 [thread overview]
Message-ID: <00f90ea2-6cda-9adf-2dfa-210828fbf996@loongson.cn> (raw)
In-Reply-To: <535ed6eaa19df38309a773f9bf2542c65f715b6b.camel@xry111.site>
在 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
>
I am testing the spec and it can be done today or tomorrow.
next prev parent reply other threads:[~2022-07-08 1:23 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 ` Lulu Cheng [this message]
2022-07-10 2:20 ` [PATCH 0/2] loongarch: improve code generation for integer division Lulu Cheng
2022-07-10 3:44 ` 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=00f90ea2-6cda-9adf-2dfa-210828fbf996@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).