From 3f0ca5a2ee36c8983b88ae4e96933c3f8f8958e9 Mon Sep 17 00:00:00 2001 From: lkcl Date: Thu, 18 Feb 2021 16:13:37 +0000 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index d56cd788c..403320efc 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -109,6 +109,17 @@ ops | NN | RA | RB | RC | 11 | 1 | 1110 110 |Rc| clmulh | | NN | RA | RB | | | | NN11 110 |Rc| rsvd | +# count leading/trailing zeros with mask + +in v3.1 p105 + +``` +count = 0 +do i = 0 to 63 if((RB)i=1) then do +if((RS)i=1) then break end end count ← count + 1 +RA ← EXTZ64(count) +``` + # bit to byte permute similar to matrix permute in RV bitmanip, which has XOR and OR variants -- 2.30.2