Browse Source
This implements the Zicond (conditional integer operations) extension, as of version 1.0-draft-20230120. 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-draft-20230120/riscv-zicond_1.0-draft-20230120.pdf for the proposed specification and usage details.pull/1241/head
committed by
Andrew Waterman
5 changed files with 12 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||
require_extension(EXT_ZICOND); |
|||
WRITE_RD(RS2 == 0 ? 0 : RS1); |
|||
@ -0,0 +1,2 @@ |
|||
require_extension(EXT_ZICOND); |
|||
WRITE_RD(RS2 != 0 ? 0 : RS1); |
|||
Loading…
Reference in new issue