(no commit message)
authorlkcl <lkcl@web>
Tue, 22 Dec 2020 19:38:22 +0000 (19:38 +0000)
committerIkiWiki <ikiwiki.info>
Tue, 22 Dec 2020 19:38:22 +0000 (19:38 +0000)
openpower/sv/vector_ops.mdwn

index 64fc9e63d1104e023ad7197a2886cad30c43360c..a7b539badc0b06272c224c2a349801ce76192351 100644 (file)
@@ -72,6 +72,15 @@ Example
 
 TODO: a Vector CR-based version of the same, due to CRs being used for predication.
 
+     def iotacr(RT, BA): 
+        mask = get_src_predicate()
+        count = 0
+        for i in range(VL):
+            if mask & (1<<i) == 0: continue
+            iregs[RT+i] = count
+            if test_CR_bit(CR[i+BA]):
+                 count += 1
+
 # Scalar
 
 These may all be viewed as suitable for fitting into a scalar bitmanip extension.