From: Luke Kenneth Casson Leighton Date: Tue, 13 Aug 2019 11:00:52 +0000 (+0100) Subject: add swizzle pseudocode example X-Git-Tag: convert-csv-opcode-to-binary~4213 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=39b545f681b8e9140418bbf147102a78d7ee7792;p=libreriscv.git add swizzle pseudocode example --- 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