public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, wilson@tuliptree.org
Subject: Re: [PATCH v1 2/8] RISC-V: costs: handle BSWAP
Date: Wed, 17 Nov 2021 22:52:37 +0800	[thread overview]
Message-ID: <CA+yXCZA4iEq9ts3vgvPg+i+HaMAwuna1-7TywOLM5sg=qZgj6A@mail.gmail.com> (raw)
In-Reply-To: <20211111141020.2738001-3-philipp.tomsich@vrull.eu>

> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
> index c77b0322869..8480cf09294 100644
> --- a/gcc/config/riscv/riscv.c
> +++ b/gcc/config/riscv/riscv.c
> @@ -2131,6 +2131,14 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN
>        *total = riscv_extend_cost (XEXP (x, 0), GET_CODE (x) == ZERO_EXTEND);
>        return false;
>
> +    case BSWAP:
> +      if (TARGET_ZBB)
> +       {
> +         *total = COSTS_N_INSNS (1);

Add a cost model for HImode? maybe `*total = COSTS_N_INSNS (mode ==
HImode ? 2 : 1);` ?

  reply	other threads:[~2021-11-17 14:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 14:10 [PATCH v1 0/8] Improvements to bitmanip-1.0 (Zb[abcs]) support Philipp Tomsich
2021-11-11 14:10 ` [PATCH v1 1/8] bswap: synthesize HImode bswap from SImode or DImode Philipp Tomsich
2021-11-17 14:51   ` Kito Cheng
2021-11-19 10:20   ` Richard Biener
2021-11-19 10:21     ` Richard Biener
2021-11-11 14:10 ` [PATCH v1 2/8] RISC-V: costs: handle BSWAP Philipp Tomsich
2021-11-17 14:52   ` Kito Cheng [this message]
2021-11-11 14:10 ` [PATCH v1 3/8] RISC-V: costs: support shift-and-add in strength-reduction Philipp Tomsich
2021-11-11 14:10 ` [PATCH v1 4/8] RISC-V: bitmanip: fix constant-loading for (1ULL << 31) in DImode Philipp Tomsich
2021-11-11 14:10 ` [PATCH v1 5/8] RISC-V: bitmanip: improvements to rotate instructions Philipp Tomsich
2021-11-11 14:10 ` [PATCH v1 6/8] RISC-V: bitmanip: add splitter to use bexti for "(a & (1 << BIT_NO)) ? 0 : -1" Philipp Tomsich
2021-11-18  9:45   ` Kito Cheng
2021-11-11 14:10 ` [PATCH v1 7/8] RISC-V: bitmanip: add orc.b as an unspec Philipp Tomsich
2021-11-11 14:10 ` [PATCH v1 8/8] RISC-V: bitmanip: relax minmax to operate on GPR Philipp Tomsich
2021-11-11 16:00   ` Kito Cheng
2021-11-11 16:18     ` Philipp Tomsich
2021-11-11 16:27       ` Kito Cheng
2021-11-11 16:42         ` Kito Cheng
2021-11-11 18:33           ` Philipp Tomsich

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='CA+yXCZA4iEq9ts3vgvPg+i+HaMAwuna1-7TywOLM5sg=qZgj6A@mail.gmail.com' \
    --to=kito.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=philipp.tomsich@vrull.eu \
    --cc=wilson@tuliptree.org \
    /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).