public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: Jivan Hakobyan <jivanhakobyan9@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: RISC-V: Replace unspec with bitreverse in riscv_brev8_<mode> insn
Date: Wed, 26 Jul 2023 16:21:18 +0800	[thread overview]
Message-ID: <CA+yXCZCwW70rOYucYKEDw8Y22AGkEc4rFVRCwX=LwUXEQui=5Q@mail.gmail.com> (raw)
In-Reply-To: <CAHso6sP4X5xFOS0295td32=BBvbtbbN2=h+G7SEJkeQ8hWrUKw@mail.gmail.com>

My understanding is the semantic is slightly different, brev8 is only
the bit reverse within each byte, but bitreverse means did bit reverse
for the whole content of the mode, e.g. riscv_brev8_si will bit
reserved within 32 bit.

Using RV32 as example:
UNSPEC_BREV8:
rd[0...7]  = rs[7...0]
rd[8...15]  = rs[15...8]
rd[16...23]  = rs[23...16]
rd[16...23]  = rs[31...24]

bitreverse:
rd[0...31] = rs[31...0]

On Wed, Jul 26, 2023 at 3:55 PM Jivan Hakobyan via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> This small patch replaces unspec opcode with bitreverse in
> riscv_brev8_<mode> insn.
>
> gcc/ChangeLog:
>         * config/riscv/crypto.md (UNSPEC_BREV8): Remov.
>         (riscv_brev8_<mode>): Use bitreverse opcode.
>
>
> --
> With the best regards
> Jivan Hakobyan

  reply	other threads:[~2023-07-26  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  7:54 Jivan Hakobyan
2023-07-26  8:21 ` Kito Cheng [this message]
2023-07-26 16:23   ` Jeff Law

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+yXCZCwW70rOYucYKEDw8Y22AGkEc4rFVRCwX=LwUXEQui=5Q@mail.gmail.com' \
    --to=kito.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jivanhakobyan9@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).