From 966e0c4179a2d9aed05583dd9a07e3442db84ad3 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 27 Apr 2023 10:54:59 +0100 Subject: [PATCH] add chacha20 introduction to REMAP Indexing --- openpower/sv/cookbook/chacha20.mdwn | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/openpower/sv/cookbook/chacha20.mdwn b/openpower/sv/cookbook/chacha20.mdwn index 0a825a326..fb473eac0 100644 --- a/openpower/sv/cookbook/chacha20.mdwn +++ b/openpower/sv/cookbook/chacha20.mdwn @@ -130,6 +130,42 @@ Let's list the additions only: x9 = x9 + x14 ``` +## Introduction to REMAP Indexing + +REMAP Indexing performs any arbitrary re-positioning of elements. +Where normally any other Vector Processor would only be able to do a +sequential element-level series of operations, and if re-ordering +of the elements is required use a special re-ordering instruction, +SVP64 can *in-place* reorder elements on *any* instruction, using +the REMAP subsystem. + +Most of the REMAP systems are simple fixed-hardware Deterministic +Schedules, but there is one that is general-purpose: Indexing. It +requires specifying a group of GPRs (or indices packed into GPRs) +that are to be used as the offsets. + +This is a normal Simple-V operation: + +``` + for i in range(VL): + GPR[RT+i] = OPERATION(GPR[RA+i]) +``` + +This is what happens when REMAP is enabled with Indexing: + +``` + def REMAP(SVSHAPE, i): + return GPR(SVSHAPE.GPR + i) + for i in range(VL): + idx_rt = REMAP(SVSHAPE0, i) + idx_ra = REMAP(SVSHAPE1, i) + GPR[RT+idx_rt] = OPERATION(GPR[RA+idx_ra]) +``` + +In this way we can literally jump about, pretty much anywhere in +the register file, according to a Schedule that is determined by +the programmer. + ## Introduction to Vertical-First Mode We're going to use Vertical-First mode (VF) to implement this, so we -- 2.30.2