From 4f524730305ba11c7b034b68156f31b41c8ca427 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 1 Jul 2022 16:15:21 +0100 Subject: [PATCH] clarify swizzle pseudocode in overview --- openpower/sv/overview.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openpower/sv/overview.mdwn b/openpower/sv/overview.mdwn index 24f1ec7f4..804d7042a 100644 --- a/openpower/sv/overview.mdwn +++ b/openpower/sv/overview.mdwn @@ -729,13 +729,13 @@ those: swizzle = get_swizzle_immed() # 12 bits for (s = 0; s < SUBVL; s++) remap = (swizzle >> 3*s) & 0b111 - if remap < 4: - sm = id*SUBVL + remap + if remap == 0b000: continue # skip + if remap == 0b001: break # end marker + if remap == 0b010: ireg[rd+s] <= 0.0 # constant 0 + elif remap == 0b011: ireg[rd+s] <= 1.0 # constant 1 + else: # XYZW + sm = id*SUBVL + (remap-4) ireg[rd+s] <= ireg[RA+sm] - elif remap == 4: - ireg[rd+s] <= 0.0 - elif remap == 5: - ireg[rd+s] <= 1.0 Note that a value of 6 (and 7) will leave the target subvector element untouched. This is equivalent to a predicate mask which is built-in, -- 2.30.2