aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@vrull.eu>2023-06-27 07:22:49 -0600
committerJeff Law <jlaw@ventanamicro>2023-06-27 07:24:43 -0600
commitb625eff8a2346fe1107aa4ab7bbf4302f2c2136e (patch)
tree9e11fce586187e074473ba6d38ea3e2be64c8697 /gas
parent15d842846d1fd79e141b1eddc9f648a8200223da (diff)
downloadgdb-b625eff8a2346fe1107aa4ab7bbf4302f2c2136e.zip
gdb-b625eff8a2346fe1107aa4ab7bbf4302f2c2136e.tar.gz
gdb-b625eff8a2346fe1107aa4ab7bbf4302f2c2136e.tar.bz2
RISC-V: Support Zicond extension
This implements the Zicond (conditional integer operations) extension, as of version 1.0-rc2. The Zicond extension acts as a building block for branchless sequences including conditional-arithmetic, conditional-logic and conditional-select/move. The following instructions constitute Zicond: - czero.eqz rd, rs1, rs2 => rd = (rs2 == 0) ? 0 : rs1 - czero.nez rd, rs1, rs2 => rd = (rs2 != 0) ? 0 : rs1 See https://github.com/riscv/riscv-zicond/releases/download/v1.0-rc2/riscv-zicond-v1.0-rc2.pdf for the proposed specification and usage details. bfd/ChangeLog: * elfxx-riscv.c (riscv_multi_subset_supports): Recognize INSN_CLASS_ZICOND. (riscv_multi_subset_supports_ext): Recognize INSN_CLASS_ZICOND. gas/ChangeLog: * testsuite/gas/riscv/zicond.d: New test. * testsuite/gas/riscv/zicond.s: New test. include/ChangeLog: * opcode/riscv-opc.h (MATCH_CZERO_EQZ): Define. (MASK_CZERO_EQZ): Define. (MATCH_CZERO_NEZ): Define, (MASK_CZERO_NEZ): Define. (DECLARE_INSN): Add czero.eqz and czero.nez. * opcode/riscv.h (enum riscv_insn_class): Add INSN_CLASS_ZICOND. opcodes/ChangeLog: * riscv-opc.c: Add czero.eqz and czero.nez. Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/gas/riscv/zicond.d12
-rw-r--r--gas/testsuite/gas/riscv/zicond.s3
2 files changed, 15 insertions, 0 deletions
diff --git a/gas/testsuite/gas/riscv/zicond.d b/gas/testsuite/gas/riscv/zicond.d
new file mode 100644
index 0000000..7a79ee6
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zicond.d
@@ -0,0 +1,12 @@
+#as: -march=rv64i_zicond
+#source: zicond.s
+#objdump: -d
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+0:[ ]+0ec5d533[ ]+czero.eqz[ ]+a0,a1,a2
+[ ]+4:[ ]+0ee6f533[ ]+czero.nez[ ]+a0,a3,a4
diff --git a/gas/testsuite/gas/riscv/zicond.s b/gas/testsuite/gas/riscv/zicond.s
new file mode 100644
index 0000000..4e5edd5
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zicond.s
@@ -0,0 +1,3 @@
+target:
+ czero.eqz a0, a1, a2
+ czero.nez a0, a3, a4