From a039fcf463a0b53a87c0b293b197ace3fee4e772 Mon Sep 17 00:00:00 2001 From: Linda Njau Date: Mon, 8 Jul 2024 15:12:00 +0300 Subject: [PATCH] Add pseudoinstruction VNEG --- model/riscv_insts_vext_arith.sail | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/model/riscv_insts_vext_arith.sail b/model/riscv_insts_vext_arith.sail index e6d26cecc..d27f1cf22 100644 --- a/model/riscv_insts_vext_arith.sail +++ b/model/riscv_insts_vext_arith.sail @@ -518,6 +518,23 @@ mapping clause assembly = VXTYPE(funct6, vm, vs2, rs1, vd) <-> vxtype_mnemonic(funct6) ^ spc() ^ vreg_name(vd) ^ sep() ^ vreg_name(vs2) ^ sep() ^ reg_name(rs1) ^ maybe_vmask(vm) /* ************************** OPIVX (WXTYPE Narrowing) *************************** */ +/* ***************************************************** */ +union clause ast = VNEG : (regidx, regidx) + +mapping clause encdec = VNEG(vs, vd) if extension("V") + <-> encdec(VXTYPE(VX_VRSUB, 0b0, vs, reg_name("x0"), vd)) if extension("V") + +mapping clause assembly = VNEG(vs, vd) + <-> "vneg.v" ^ spc() ^ vreg_name(vd) ^ sep() ^ vreg_name(vs) + +function clause execute(VNEG(vs, vd)) = execute(VXTYPE(VX_VRSUB, 0b0, vs, reg_name("x0"), vd)) + +val pseudo_of : ast <-> string +scattered mapping pseudo_of +mapping clause pseudo_of = VNEG(vs, vd) + <-> "vrsub.vx" ^ spc() ^ vreg_name(vd) ^ sep() ^ vreg_name(vs) ^ sep() ^"x0" + +/* ***************************************************** */ /* ************** Vector Narrowing Integer Right Shift Instructions ************** */ union clause ast = NXSTYPE : (nxsfunct6, bits(1), regidx, regidx, regidx)