(no commit message)
authorlkcl <lkcl@web>
Sat, 4 Jun 2022 21:12:49 +0000 (22:12 +0100)
committerIkiWiki <ikiwiki.info>
Sat, 4 Jun 2022 21:12:49 +0000 (22:12 +0100)
openpower/sv/shape_table_format.mdwn

index 031ac7616b207162993eeb1508fdf0c618cd36b2..7c6a65b985fdddc716e3bfa5a68d0a9022448c48 100644 (file)
@@ -115,7 +115,25 @@ def index_remap(i):
     return GPR((SVSHAPE.SVGPR<<1)+i+SVSHAPE.offset)
 
 for i in 0..VL-1:
-    GPR(RT + indexed_remap(i) + SVSHAPE.offset) = ....
+    element_result = ....
+    GPR(RT + indexed_remap(i)) = element_result
+```
+
+With element-width overrides included, and using the pseudocode
+from the SVP64 [[sv/svp64/appendix#elwidth]] elwidth section
+this becomes:
+
+```
+def index_remap(i):
+    svreg = SVSHAPE.SVGPR << 1
+    srcwid = elwid_to_bitwidth(SVSHAPE.elwid)
+    offs = SVSHAPE.offset
+    return get_polymorphed_reg(svreg, srcwid, i) + offs
+
+for i in 0..VL-1:
+    element_result = ....
+    rt_idx = indexed_remap(i)
+    set_polymorphed_reg(RT, destwid, rt_idx, element_result)
 ```
 
 Matrix-style reordering still applies to the indices, except limited