public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>,
	Nelson Chu <nelson.chu@sifive.com>,
	Kito Cheng <kito.cheng@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>
Cc: binutils@sourceware.org
Subject: [PATCH 0/5] RISC-V: Opcode tidying (batch 1)
Date: Sat,  9 Jul 2022 18:09:09 +0900	[thread overview]
Message-ID: <cover.1657357697.git.research_trasio@irq.a4lg.com> (raw)

Hello,

This patchset contains various tidying of RISC-V opcodes (this is the
first batch).

The background of this patchset is partially semi-automated comparison
with riscv-opc.h in GNU Binutils and encoding.h generated by
riscv-opcodes (https://github.com/riscv/riscv-opcodes).

Tracker on GitHub:
<https://github.com/a4lg/binutils-gdb/wiki/riscv_opcode_tidying_1>


[Overview of this Patchset]

1.  Instruction Name Maintainance
    a.  Remove unused instructions [PATCH 1]
    b.  Use ecall/ebreak instead of scall/sbreak
        (remove scall/sbreak-related macros) [PATCH 2]
    c.  Use fmv.w.x/fmv.x.w instead of fmv.s.x/fmv.x.s [PATCH 3]
    d.  Make alias instruction real aliases [PATCH 5]
2.  Prefer using defined mask and match values
    (applies to c.nop and fence.i) [PATCH 4]


Note that this patchset doesn't:

-   Remove existing instructions
    (just removes unused mask and match macros behind the instruction)
-   Change macro values (just names and formatting)
-   Replace riscv-opc.h with riscv-opcodes generated one.


If you use riscv-opcodes for new instructions (copy portions of
encoding.h to riscv-opc.h), porting new instruction will be easy and the
result will be more consistent.  I tried this approach on upcoming
Zihintntl patchset and it worked pretty well.

This patchset is only about refactoring and maintainance.
Nothing functional.

Thanks,
Tsukasa




Tsukasa OI (5):
  RISC-V: Remove unused instruction macros
  RISC-V: Complete tidying up with SCALL and SBREAK
  RISC-V: Tidying up with fmv.w.x and fmv.x.w
  RISC-V: Use defined mask and match values
  RISC-V: Make alias instructions aliases

 include/opcode/riscv-opc.h | 47 +++++---------------------------------
 opcodes/riscv-opc.c        | 18 +++++++--------
 sim/riscv/sim-main.c       |  6 ++---
 3 files changed, 18 insertions(+), 53 deletions(-)


base-commit: d2acd4b0c5bab349aaa152d60268bc144634a844
-- 
2.34.1


             reply	other threads:[~2022-07-09  9:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  9:09 Tsukasa OI [this message]
2022-07-09  9:09 ` [PATCH 1/5] RISC-V: Remove unused instruction macros Tsukasa OI
2022-07-09  9:09 ` [PATCH 2/5] RISC-V: Complete tidying up with SCALL and SBREAK Tsukasa OI
2022-07-09  9:09 ` [PATCH 3/5] RISC-V: Tidying up with fmv.w.x and fmv.x.w Tsukasa OI
2022-07-09  9:09 ` [PATCH 4/5] RISC-V: Use defined mask and match values Tsukasa OI
2022-07-09  9:09 ` [PATCH 5/5] RISC-V: Make alias instructions aliases Tsukasa OI
2022-10-19 13:11 ` [PATCH v2 0/8] RISC-V: Various opcode tidying (batch 1) Tsukasa OI
2022-10-19 13:11   ` [PATCH v2 1/8] RISC-V: Add a space at the end of pinfo Tsukasa OI
2022-10-19 13:11   ` [PATCH v2 2/8] RISC-V: Fix obvious misalignments ('Zbb'/'Zba') Tsukasa OI
2022-10-19 13:11   ` [PATCH v2 3/8] RISC-V: Remove spaces in opcode entries Tsukasa OI
2022-10-19 13:11   ` [PATCH v2 4/8] RISC-V: Remove unused instruction macros Tsukasa OI
2022-10-19 13:11   ` [PATCH v2 5/8] RISC-V: Complete tidying up with SCALL and SBREAK Tsukasa OI
2022-10-19 13:12   ` [PATCH v2 6/8] RISC-V: Tidying up with fmv.w.x and fmv.x.w Tsukasa OI
2022-10-19 13:12   ` [PATCH v2 7/8] RISC-V: Make alias instructions aliases Tsukasa OI
2022-10-19 13:12   ` [PATCH v2 8/8] RISC-V: Use defined mask and match values Tsukasa OI
2022-11-05 11:51   ` [PING^1][PATCH v2 0/8] RISC-V: Various opcode tidying (batch 1) Tsukasa OI
2022-11-15  4:31   ` [PATCH v3 " Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 1/8] RISC-V: Add a space at the end of pinfo Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 2/8] RISC-V: Fix obvious misalignments ('Zbb'/'Zba') Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 3/8] RISC-V: Remove spaces in opcode entries Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 4/8] RISC-V: Remove unused instruction macros Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 5/8] RISC-V: Complete tidying up with SCALL and SBREAK Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 6/8] RISC-V: Tidying up with fmv.w.x and fmv.x.w Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 7/8] RISC-V: Make alias instructions aliases Tsukasa OI
2022-11-15  4:31     ` [PATCH v3 8/8] RISC-V: Use defined mask and match values Tsukasa OI
2022-11-18  2:07     ` [PATCH v4 0/8] RISC-V: Various opcode tidying (batch 1) Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 1/8] RISC-V: Add a space at the end of pinfo Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 2/8] RISC-V: Fix obvious misalignments ('Zbb'/'Zba') Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 3/8] RISC-V: Remove spaces in opcode entries Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 4/8] RISC-V: Remove unused instruction macros Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 5/8] RISC-V: Complete tidying up with SCALL and SBREAK Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 6/8] RISC-V: Tidying up with fmv.w.x and fmv.x.w Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 7/8] RISC-V: Make alias instructions aliases Tsukasa OI
2022-11-18  2:07       ` [PATCH v4 8/8] RISC-V: Use defined mask and match values Tsukasa OI

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=cover.1657357697.git.research_trasio@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=binutils@sourceware.org \
    --cc=kito.cheng@sifive.com \
    --cc=nelson.chu@sifive.com \
    --cc=palmer@dabbelt.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).