From 527efabfbe08f5ce2ea81b4bf26d8b194eb109b5 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 17 May 2022 12:56:52 +0100 Subject: [PATCH] add first exploration of 4-wide AOI --- openpower/sv/grevlut_v2.py | 110 +++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 openpower/sv/grevlut_v2.py diff --git a/openpower/sv/grevlut_v2.py b/openpower/sv/grevlut_v2.py new file mode 100644 index 000000000..9da592801 --- /dev/null +++ b/openpower/sv/grevlut_v2.py @@ -0,0 +1,110 @@ + +def andor(imm, a, b, ainv, binv): + inbits = [a, b, ainv, binv] + res = 0 + for i in range(4): + if ((imm >> i) & 0b1) & inbits[i]: + res = 1 + return res + +def dorow(imm8, step_i, chunk_size): + step_o = 0 + for j in range(64): + if (j&chunk_size) == 0: + imm = (imm8 & 0b1111) + else: + imm = (imm8>>4) + a = (step_i>>j)&1 + b = (step_i>>(j ^ chunk_size))&1 + res = andor(imm, a, b, ~a, ~b) + #print(j, bin(imm), a, b, res) + step_o |= (res<