From 39b545f681b8e9140418bbf147102a78d7ee7792 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 13 Aug 2019 12:00:52 +0100 Subject: [PATCH] add swizzle pseudocode example --- simple_v_extension/abridged_spec.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/simple_v_extension/abridged_spec.mdwn b/simple_v_extension/abridged_spec.mdwn index 4b52c4897..0bab079dd 100644 --- a/simple_v_extension/abridged_spec.mdwn +++ b/simple_v_extension/abridged_spec.mdwn @@ -235,6 +235,21 @@ if this occurs. [[!inline raw="yes" pages="simple_v_extension/swizzle_table_format" ]] +Pseudocode when SUBVL=4 and swizzle is set on rd: + + # decode the swizzle table entry for rd + x = swizzle[0:1] + y = swizzle[2:3] + z = swizzle[4:5] + w = swizzle[6:7] + + # loop on VL: SUBVL loop is unrolled + for (i in 0; i < VL; i++) + ireg[rd+i*4+x] = OPERATION(ireg[rs1+i*4+0], ireg[rs2+i*4+0]) + ireg[rd+i*4+y] = OPERATION(ireg[rs1+i*4+1], ireg[rs2+i*4+1]) + ireg[rd+i*4+z] = OPERATION(ireg[rs1+i*4+2], ireg[rs2+i*4+2]) + ireg[rd+i*4+w] = OPERATION(ireg[rs1+i*4+3], ireg[rs2+i*4+3]) + For more information on swizzling, see the Khronos wiki page -- 2.30.2