From e8a5223ee7bbe3d3d99fec570441f71090c9dfb4 Mon Sep 17 00:00:00 2001 From: lkcl Date: Tue, 22 Dec 2020 18:49:29 +0000 Subject: [PATCH] --- openpower/sv/vector_ops.mdwn | 83 +++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/openpower/sv/vector_ops.mdwn b/openpower/sv/vector_ops.mdwn index 01c385156..770c46210 100644 --- a/openpower/sv/vector_ops.mdwn +++ b/openpower/sv/vector_ops.mdwn @@ -102,6 +102,27 @@ Example The vmsbf.m instruction takes a mask register as input and writes results to a mask register. The instruction writes a 1 to all active mask elements before the first source element that is a 1, then writes a 0 to that element and all following active elements. If there is no set bit in the source vector, then all active elements in the destination are written with a 1. +pseudocode: + + def sbf(rd, rs1, rs2): + rd = 0 + # start setting if no predicate or if 1st predicate bit set + setting_mode = rs2 == x0 or (regs[rs2] & 1) + while i < XLEN: + bit = 1<