[PATCH 2/2] RISC-V: Make `fence.tso' a non-alias
Tsukasa OI
research_trasio@irq.a4lg.com
Sat Jul 9 03:50:15 GMT 2022
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
More information about the Binutils
mailing list