From: Luke Kenneth Casson Leighton Date: Tue, 17 May 2022 11:56:52 +0000 (+0100) Subject: add first exploration of 4-wide AOI X-Git-Tag: opf_rfc_ls005_v1~2180 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=527efabfbe08f5ce2ea81b4bf26d8b194eb109b5;p=libreriscv.git add first exploration of 4-wide AOI --- 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<