From: Kito Cheng <kito.cheng@gmail.com>
To: binutils@sourceware.org, Jim Wilson <jimw@sifive.com>
Cc: Palmer Dabbelt <palmer@sifive.com>, patches@groups.riscv.org
Subject: [PATCH] RISC-V: bge[u] should get higher priority than ble[u].
Date: Mon, 17 Sep 2018 08:32:00 -0000 [thread overview]
Message-ID: <CA+yXCZCLo6fuN0RarEHeOfvyng29p_9U277Qdw9a_f3ZcaUJNQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
Hi all:
This patch is fixing the behavior of disassembler for bge[u], bge[u]
and ble[u] will disassemble to ble[u] currently, however ble[u] is
pseudo/alias instruction, so I think it should disassemble into bge[u]
instead of ble[u].
ChangeLog:
2018-09-17 Kito Cheng <kito@andestech.com>
gas/
* testsuite/gas/riscv/bge.d: New.
* testsuite/gas/riscv/bge.s: Likewise.
opcodes/
* riscv-opc.c (riscv_opcodes): Adjust the order of ble and
bleu.
[-- Attachment #2: 0001-RISC-V-bge-u-should-get-higher-priority-than-ble-u.patch --]
[-- Type: text/x-patch, Size: 2979 bytes --]
From d7642844eff412159fc9bbc530fe31191ab5c2e0 Mon Sep 17 00:00:00 2001
From: Kito Cheng <kito.cheng@gmail.com>
Date: Mon, 17 Sep 2018 14:07:27 +0800
Subject: [PATCH] RISC-V: bge[u] should get higher priority than ble[u].
2018-09-17 Kito Cheng <kito@andestech.com>
gas/
* testsuite/gas/riscv/bge.d: New.
* testsuite/gas/riscv/bge.s: Likewise.
opcodes/
* riscv-opc.c (riscv_opcodes): Adjust the order of ble and
bleu.
---
gas/testsuite/gas/riscv/bge.d | 13 +++++++++++++
gas/testsuite/gas/riscv/bge.s | 5 +++++
opcodes/riscv-opc.c | 4 ++--
3 files changed, 20 insertions(+), 2 deletions(-)
create mode 100644 gas/testsuite/gas/riscv/bge.d
create mode 100644 gas/testsuite/gas/riscv/bge.s
diff --git a/gas/testsuite/gas/riscv/bge.d b/gas/testsuite/gas/riscv/bge.d
new file mode 100644
index 0000000000..b3db91c7e1
--- /dev/null
+++ b/gas/testsuite/gas/riscv/bge.d
@@ -0,0 +1,13 @@
+#as:
+#objdump: -d
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <foo>:
+[ ]+0:[ ]+00c5d063[ ]+bge[ ]+a1,a2,0 \<foo\>
+[ ]+4:[ ]+feb65ee3[ ]+bge[ ]+a2,a1,0 \<foo\>
+[ ]+8:[ ]+fec5fce3[ ]+bgeu[ ]+a1,a2,0 \<foo\>
+[ ]+c:[ ]+feb67ae3[ ]+bgeu[ ]+a2,a1,0 \<foo\>
diff --git a/gas/testsuite/gas/riscv/bge.s b/gas/testsuite/gas/riscv/bge.s
new file mode 100644
index 0000000000..a28d25ea02
--- /dev/null
+++ b/gas/testsuite/gas/riscv/bge.s
@@ -0,0 +1,5 @@
+foo:
+ bge a1, a2, foo
+ ble a1, a2, foo
+ bgeu a1, a2, foo
+ bleu a1, a2, foo
diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c
index 945164a511..e0f711811f 100644
--- a/opcodes/riscv-opc.c
+++ b/opcodes/riscv-opc.c
@@ -250,10 +250,10 @@ const struct riscv_opcode riscv_opcodes[] =
{"beq", 0, {"I", 0}, "s,t,p", MATCH_BEQ, MASK_BEQ, match_opcode, INSN_CONDBRANCH },
{"blez", 0, {"I", 0}, "t,p", MATCH_BGE, MASK_BGE | MASK_RS1, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
{"bgez", 0, {"I", 0}, "s,p", MATCH_BGE, MASK_BGE | MASK_RS2, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
-{"ble", 0, {"I", 0}, "t,s,p", MATCH_BGE, MASK_BGE, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
-{"bleu", 0, {"I", 0}, "t,s,p", MATCH_BGEU, MASK_BGEU, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
{"bge", 0, {"I", 0}, "s,t,p", MATCH_BGE, MASK_BGE, match_opcode, INSN_CONDBRANCH },
{"bgeu", 0, {"I", 0}, "s,t,p", MATCH_BGEU, MASK_BGEU, match_opcode, INSN_CONDBRANCH },
+{"ble", 0, {"I", 0}, "t,s,p", MATCH_BGE, MASK_BGE, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
+{"bleu", 0, {"I", 0}, "t,s,p", MATCH_BGEU, MASK_BGEU, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
{"bltz", 0, {"I", 0}, "s,p", MATCH_BLT, MASK_BLT | MASK_RS2, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
{"bgtz", 0, {"I", 0}, "t,p", MATCH_BLT, MASK_BLT | MASK_RS1, match_opcode, INSN_ALIAS|INSN_CONDBRANCH },
{"blt", 0, {"I", 0}, "s,t,p", MATCH_BLT, MASK_BLT, match_opcode, INSN_CONDBRANCH },
--
2.17.1
next reply other threads:[~2018-09-17 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 8:32 Kito Cheng [this message]
2018-09-17 18:45 ` Jim Wilson
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+yXCZCLo6fuN0RarEHeOfvyng29p_9U277Qdw9a_f3ZcaUJNQ@mail.gmail.com \
--to=kito.cheng@gmail.com \
--cc=binutils@sourceware.org \
--cc=jimw@sifive.com \
--cc=palmer@sifive.com \
--cc=patches@groups.riscv.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).