From 0d3123f7000cfe65e1e8a443241274be129e88ad Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 21 Oct 2018 16:23:54 +0100 Subject: [PATCH] add add/addw examples --- simple_v_extension/specification.mdwn | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/simple_v_extension/specification.mdwn b/simple_v_extension/specification.mdwn index f9c687fa0..f5fc87d20 100644 --- a/simple_v_extension/specification.mdwn +++ b/simple_v_extension/specification.mdwn @@ -1455,6 +1455,42 @@ polymorphic widths, to ensure that it is correct. ### add +Standard Scalar RV32/RV64 (xlen): + +* RS1 @ xlen bits +* RS2 @ xlen bits +* add @ xlen bits +* RD @ xlen bits + +Polymorphic variant: + +* RS1 @ rs1 bits, zero-extended to max(rs1, rs2) bits +* RS2 @ rs2 bits, zero-extended to max(rs1, rs2) bits +* add @ max(rs1, rs2) bits +* RD @ rd bits. zero-extend to rd if rd > max(rs1, rs2) otherwise truncate + +Note here that polymorphic add zero-extends its source operands, +where addw sign-extends. + +### addw + +Standard Scalar RV32/RV64 (xlen): + +* RS1 @ xlen bits +* RS2 @ xlen bits +* add @ xlen bits +* RD @ xlen bits, truncate add to 32-bit and sign-extend to xlen. + +Polymorphic variant: + +* RS1 @ rs1 bits, sign-extended to max(rs1, rs2) bits +* RS2 @ rs2 bits, sign-extended to max(rs1, rs2) bits +* add @ max(rs1, rs2) bits +* RD @ rd bits. sign-extend to rd if rd > max(rs1, rs2) otherwise truncate + +Note here that polymorphic addw sign-extends its source operands, +where add zero-extends. + TODO # Exceptions -- 2.30.2