From 9127940e0591f5cac4f9820b4fab0f66e6f1ffa3 Mon Sep 17 00:00:00 2001 From: lkcl Date: Mon, 13 Jun 2022 23:15:19 +0100 Subject: [PATCH] --- openpower/sv/mv.swizzle.mdwn | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/openpower/sv/mv.swizzle.mdwn b/openpower/sv/mv.swizzle.mdwn index b6b121875..af419bf8b 100644 --- a/openpower/sv/mv.swizzle.mdwn +++ b/openpower/sv/mv.swizzle.mdwn @@ -161,8 +161,6 @@ Swizzle Pseudocode: if swiz[i] == 0b001: dst_subvl = i+1 break - # source subvector length is maximum of both RM fields - src_subvl = MAX(SRC_SUBVL, SUBVL) ``` What is going on here is that the option is provided to have different @@ -172,6 +170,26 @@ each destination position, the marker "0b001" may be used to indicate the end. If no marker is present then the destination subvector length may be assumed to be 4. +``` + def index_src(): + for i in range(VL): + for j in range(SUBVL): + if swiz[j] == 0b000: # skip + continue + if swiz[j] == 0b001: # end + break + if swiz[j] in [0b010, 0b011]: + yield (i*SUBVL, CONSTANT) + else: + yield (i*SUBVL, swiz[j]-3) + + # yield an outer-SUBVL, inner VL loop with DEST SUBVL + def index_dest(): + for i in range(VL): + for j in range(dst_subvl): + yield i*dst_subvl+j +``` + **Effect of Saturation on Vectorised Swizzle** A useful convenience for pixel data is to be able to insert values -- 2.30.2