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 2/2] RISC-V: Make `fence.tso' a non-alias
Date: Sat,  9 Jul 2022 12:50:15 +0900	[thread overview]
Message-ID: <ece3ba0521aa46fb8fc4f7615c3a652a9b2a80c0.1657338599.git.research_trasio@irq.a4lg.com> (raw)
In-Reply-To: <cover.1657338599.git.research_trasio@irq.a4lg.com>

While `fence.tso' is a subset of original `FENCE' instruction in RISC-V
ISA, `fence' instruction as defined in the GNU Binutils (constrained to
fm=0b0000) is not a superset of `fence.tso'.  As a result, it resulted
in `.4byte' when disassembled with `no-aliases` option.
This commit makes `fence.tso' instruction a non-alias.

gas/ChangeLog:

	* testsuite/gas/riscv/fence-tso.d: Make sure that `fence.tso'
	is currently not an alias.

opcodes/ChangeLog:

	* riscv-opc.c (riscv_opcodes): Make `fence.tso' instruction
	a non-alias.
---
 gas/testsuite/gas/riscv/fence-tso.d | 2 +-
 opcodes/riscv-opc.c                 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gas/testsuite/gas/riscv/fence-tso.d b/gas/testsuite/gas/riscv/fence-tso.d
index ef8a4cdd1c9..00170f1259e 100644
--- a/gas/testsuite/gas/riscv/fence-tso.d
+++ b/gas/testsuite/gas/riscv/fence-tso.d
@@ -1,5 +1,5 @@
 #as: -march=rv32ic
-#objdump: -dr
+#objdump: -dr -M no-aliases
 
 .*:[ 	]+file format .*
 
diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c
index 6c5b2eaf524..50a51b40d69 100644
--- a/opcodes/riscv-opc.c
+++ b/opcodes/riscv-opc.c
@@ -421,7 +421,7 @@ const struct riscv_opcode riscv_opcodes[] =
 {"fence",       0, INSN_CLASS_I, "",          MATCH_FENCE|MASK_PRED|MASK_SUCC, MASK_FENCE|MASK_RD|MASK_RS1|MASK_IMM, match_opcode, INSN_ALIAS },
 {"fence",       0, INSN_CLASS_I, "P,Q",       MATCH_FENCE, MASK_FENCE|MASK_RD|MASK_RS1|(MASK_IMM & ~MASK_PRED & ~MASK_SUCC), match_opcode, 0 },
 {"fence.i",     0, INSN_CLASS_ZIFENCEI, "",   MATCH_FENCE_I, MASK_FENCE|MASK_RD|MASK_RS1|MASK_IMM, match_opcode, 0 },
-{"fence.tso",   0, INSN_CLASS_I, "",          MATCH_FENCE_TSO, MASK_FENCE_TSO|MASK_RD|MASK_RS1, match_opcode, INSN_ALIAS },
+{"fence.tso",   0, INSN_CLASS_I, "",          MATCH_FENCE_TSO, MASK_FENCE_TSO|MASK_RD|MASK_RS1, match_opcode, 0 },
 {"rdcycle",     0, INSN_CLASS_I, "d",         MATCH_RDCYCLE, MASK_RDCYCLE, match_opcode, INSN_ALIAS },
 {"rdinstret",   0, INSN_CLASS_I, "d",         MATCH_RDINSTRET, MASK_RDINSTRET, match_opcode, INSN_ALIAS },
 {"rdtime",      0, INSN_CLASS_I, "d",         MATCH_RDTIME, MASK_RDTIME, match_opcode, INSN_ALIAS },
-- 
2.34.1


      parent reply	other threads:[~2022-07-09  3:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  3:50 [PATCH 0/2] RISC-V: Make some instruction non-aliases to fix a disassembler issue Tsukasa OI
2022-07-09  3:50 ` [PATCH 1/2] RISC-V: Make `zip'/`unzip' on Zbkb non-aliases Tsukasa OI
2022-07-09  3:50 ` Tsukasa OI [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=ece3ba0521aa46fb8fc4f7615c3a652a9b2a80c0.1657338599.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).