From 50a7076ed0b9015112b61cd9d5e62bc22be2c152 Mon Sep 17 00:00:00 2001 From: lkcl Date: Sat, 4 Jun 2022 22:12:49 +0100 Subject: [PATCH] --- openpower/sv/shape_table_format.mdwn | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/openpower/sv/shape_table_format.mdwn b/openpower/sv/shape_table_format.mdwn index 031ac7616..7c6a65b98 100644 --- a/openpower/sv/shape_table_format.mdwn +++ b/openpower/sv/shape_table_format.mdwn @@ -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 -- 2.30.2