From: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
To: pinskia <pinskia@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
kito.cheng <kito.cheng@gmail.com>
Subject: Re: Re: [PATCH] RISC-V: Support (set (mem) (const_poly_int))
Date: Mon, 24 Oct 2022 10:22:29 +0800 [thread overview]
Message-ID: <4F51D7AE6590B996+2022102410222898101289@rivai.ai> (raw)
In-Reply-To: <CA+=Sn1nz=v5mZ9FZS5f8nmFBqgjLmPeZEfX7tWjT1DpS7MxqiQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1661 bytes --]
Address comments. Fix it soon.
juzhe.zhong@rivai.ai
From: Andrew Pinski
Date: 2022-10-24 10:14
To: juzhe.zhong
CC: gcc-patches; kito.cheng
Subject: Re: [PATCH] RISC-V: Support (set (mem) (const_poly_int))
On Sun, Oct 23, 2022 at 7:04 PM <juzhe.zhong@rivai.ai> wrote:
>
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
>
> gcc/ChangeLog:
>
> * config/riscv/riscv.cc (riscv_legitimize_move): Support (set (mem) (const_poly_int)).
>
> ---
> gcc/config/riscv/riscv.cc | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 90a39047dd7..f7694ba043c 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -1958,6 +1958,20 @@ riscv_legitimize_move (machine_mode mode, rtx dest, rtx src)
> {
> if (CONST_POLY_INT_P (src))
> {
> + /*
> + Handle:
> + (insn 183 182 184 6 (set (mem:QI (plus:DI (reg/f:DI 156)
> + (const_int 96 [0x60])) [0 S1 A8])
> + (const_poly_int:QI [8, 8]))
> + "../../../../riscv-gcc/libgcc/unwind-dw2.c":1579:3 -1 (nil))
> + */
> + if (MEM_P (dest))
> + {
> + rtx tmp = gen_reg_rtx (mode);
> + emit_move_insn (tmp, src);
> + emit_move_insn (dest, tmp);
Couldn't you just use force_reg here instead of the above?
Something like:
emit_move_insn (dest, force_reg (mode, src));
Thanks,
Andrew Pinski
> + return true;
> + }
> poly_int64 value = rtx_to_poly_int64 (src);
> if (!value.is_constant () && !TARGET_VECTOR)
> {
> --
> 2.36.1
>
prev parent reply other threads:[~2022-10-24 2:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 2:03 juzhe.zhong
2022-10-24 2:14 ` Andrew Pinski
2022-10-24 2:22 ` juzhe.zhong [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=4F51D7AE6590B996+2022102410222898101289@rivai.ai \
--to=juzhe.zhong@rivai.ai \
--cc=gcc-patches@gcc.gnu.org \
--cc=kito.cheng@gmail.com \
--cc=pinskia@gmail.com \
/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).