From 4e2b18982ade10897e62590896a1dec496269877 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Mon, 17 Sep 2018 11:43:08 -0700 Subject: [PATCH] RISC-V: bge[u] should get higher priority than ble[u]. 2018-09-17 Kito Cheng 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/ChangeLog | 5 +++++ gas/testsuite/gas/riscv/bge.d | 13 +++++++++++++ gas/testsuite/gas/riscv/bge.s | 5 +++++ opcodes/ChangeLog | 4 ++++ opcodes/riscv-opc.c | 4 ++-- 5 files changed, 29 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/ChangeLog b/gas/ChangeLog index 3e7680049af..0a4c5665784 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2018-09-17 Kito Cheng + + * testsuite/gas/riscv/bge.d: New. + * testsuite/gas/riscv/bge.s: Likewise. + 2018-09-17 H.J. Lu PR gas/23670 diff --git a/gas/testsuite/gas/riscv/bge.d b/gas/testsuite/gas/riscv/bge.d new file mode 100644 index 00000000000..b3db91c7e11 --- /dev/null +++ b/gas/testsuite/gas/riscv/bge.d @@ -0,0 +1,13 @@ +#as: +#objdump: -d + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+0:[ ]+00c5d063[ ]+bge[ ]+a1,a2,0 \ +[ ]+4:[ ]+feb65ee3[ ]+bge[ ]+a2,a1,0 \ +[ ]+8:[ ]+fec5fce3[ ]+bgeu[ ]+a1,a2,0 \ +[ ]+c:[ ]+feb67ae3[ ]+bgeu[ ]+a2,a1,0 \ diff --git a/gas/testsuite/gas/riscv/bge.s b/gas/testsuite/gas/riscv/bge.s new file mode 100644 index 00000000000..a28d25ea029 --- /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/ChangeLog b/opcodes/ChangeLog index 5d575070727..19475dae8ad 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2018-09-17 Kito Cheng + + * riscv-opc.c (riscv_opcodes): Adjust the order of ble and bleu. + 2018-09-17 H.J. Lu PR gas/23670 diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c index 945164a5113..e0f711811f6 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.30.2