From: Luke Kenneth Casson Leighton Date: Thu, 13 Feb 2020 18:14:14 +0000 (+0000) Subject: finish table-conversion of dynamic shift X-Git-Tag: convert-csv-opcode-to-binary~3438 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c91fe75fe52a55ba72457c560e129e3eb40211cb;p=libreriscv.git finish table-conversion of dynamic shift --- diff --git a/3d_gpu/architecture/dynamic_simd/shift.mdwn b/3d_gpu/architecture/dynamic_simd/shift.mdwn index dce5142de..d6bc35e6f 100644 --- a/3d_gpu/architecture/dynamic_simd/shift.mdwn +++ b/3d_gpu/architecture/dynamic_simd/shift.mdwn @@ -49,7 +49,11 @@ p2p1p0 | o0 | o1 | o2 | o3 1 1 1 | a0b0 | a1b1 | a2b2 | a3b3 """]] -Therefore, the actual output for o1 looks something like this: +For o0 the output is simple: a0b0 for all partition permutations. + + o0 = a0b0[7:0] + +The output for o1 looks something like this: p2p1p0 : o1 0 0 0 : a0b0[15:8] | a1b0[7:0] @@ -61,44 +65,55 @@ Therefore, the actual output for o1 looks something like this: 1 1 0 | a0b0[15:8] | a1b0[7:0] 1 1 1 | a0b0[15:8] | a1b1[7:0] + if True: o1 = a0b0[15:8] + if ~p0: o1 |= a1b0[7:0] + if p0: o1 |= a1b1[7:0] + For o2: p2p1p0 : o2 - 0 0 0 | a0b0[23:16] | a1b0[15:8] | a2b0 - 0 0 1 | a0b0[23:16] | a1b1[15:8] | a2b1 - 0 1 0 | a0b0[23:16] | a1b0[15:8] | a2b2 - 0 1 1 | a0b0[23:16] | a1b1[15:8] | a2b2 - 1 0 0 | a0b0[23:16] | a1b0[15:8] | a2b0 - 1 0 1 | a0b0[23:16] | a1b1[15:8] | a2b1 - 1 1 0 | a0b0[23:16] | a1b0[15:8] | a2b2 - 1 1 1 | a0b0[23:16] | a1b1[15:8] | a2b2 + 0 0 0 | a0b0[23:16] | a1b0[15:8] | a2b0[7:0] + 0 0 1 | a0b0[23:16] | a1b1[15:8] | a2b1[7:0] + 0 1 0 | a0b0[23:16] | a1b0[15:8] | a2b2[7:0] + 0 1 1 | a0b0[23:16] | a1b1[15:8] | a2b2[7:0] + 1 0 0 | a0b0[23:16] | a1b0[15:8] | a2b0[7:0] + 1 0 1 | a0b0[23:16] | a1b1[15:8] | a2b1[7:0] + 1 1 0 | a0b0[23:16] | a1b0[15:8] | a2b2[7:0] + 1 1 1 | a0b0[23:16] | a1b1[15:8] | a2b2[7:0] + + therefore: + + if True: o2 = a0b0[23:16] + if ~p0: o2 |= a1b0[15:0] + if p0: o2 |= a1b1[15:0] + if ~p0&~p1: o2 |= a2b0[7:0] + if p0&~p1: o2 |= a2b1[7:0] + if ~p1: o2 |= a2b2[7:0] For o3: p2p1p0 | o3 - 0 0 0 | a0b0[31:24] | a1b0[23:16] | a2b0[15:8] | a3b0 - 0 0 1 | a0b0[31:24] | a1b1[23:16] | a2b1[15:8] | a3b1 - 0 1 0 | a0b0[31:24] | a1b0[23:16] | a2b2[15:8] | a3b2 - 0 1 1 | a0b0[31:24] | a1b1[23:16] | a2b2[15:8] | a3b2 - 1 0 0 | a0b0[31:24] | a1b0[23:16] | a2b0[15:8] | a3b3 - 1 0 1 | a0b0[31:24] | a1b1[23:16] | a2b1[15:8] | a3b3 - 1 1 0 | a0b0[31:24] | a1b0[23:16] | a2b2[15:8] | a3b3 - 1 1 1 | a0b0[31:24] | a1b1[23:16] | a2b2[15:8] | a3b3 + 0 0 0 | a0b0[31:24] | a1b0[23:16] | a2b0[15:8] | a3b0[7:0] + 0 0 1 | a0b0[31:24] | a1b1[23:16] | a2b1[15:8] | a3b1[7:0] + 0 1 0 | a0b0[31:24] | a1b0[23:16] | a2b2[15:8] | a3b2[7:0] + 0 1 1 | a0b0[31:24] | a1b1[23:16] | a2b2[15:8] | a3b2[7:0] + 1 0 0 | a0b0[31:24] | a1b0[23:16] | a2b0[15:8] | a3b3[7:0] + 1 0 1 | a0b0[31:24] | a1b1[23:16] | a2b1[15:8] | a3b3[7:0] + 1 1 0 | a0b0[31:24] | a1b0[23:16] | a2b2[15:8] | a3b3[7:0] + 1 1 1 | a0b0[31:24] | a1b1[23:16] | a2b2[15:8] | a3b3[7:0] therefore: - if True: o3 = a0b0[31:24] + if True: o3 = a0b0[31:24] if ~p0: o3 |= a1b0[23:16] if p0: o3 |= a1b1[23:16] if ~p0&p1: o3 |= a2b1[15:8] if p0&p1: o3 |= a2b0[15:8] if p1: o3 |= a2b2[15:8] - if ~p0&~p1&~p2: o3 |= a3b0 - if p0&~p1&~p2: o3 |= a3b1 - if p1&~p2: o3 |= a3b2 - if p2: o3 |= a3b3 - -Where for o0 the output is simple: a0b0 for all partition permutations. + if ~p0&~p1&~p2: o3 |= a3b0[7:0] + if p0&~p1&~p2: o3 |= a3b1[7:0] + if p1&~p2: o3 |= a3b2[7:0] + if p2: o3 |= a3b3[7:0] ## Note