[Libre-soc-bugs] [Bug 782] add galois field bitmanip instructions

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Mar 3 03:31:10 GMT 2022


https://bugs.libre-soc.org/show_bug.cgi?id=782

--- Comment #1 from Jacob Lifshay <programmerjake at gmail.com> ---
I could be wrong, but from what I know of how Galois fields work, the degree
parameter is entirely derived from the reducing polynomial:
if the reducing polynomial is the AES one:
x^8 + x^4 + x^3 + x + 1
or, in binary: 100011011  in hex: 0x11B
So, here, the degree=8 since that's the largest exponent in the polynomial.

In my opinion, we should just have the reducing polynomial as an input or
immediate, and derive the degree from it, rather than having degree being a
separate input/immediate and wasting encoding space.

Alternatively, we could have the degree fixed to XLEN, and just have the
reducing polynomial specify the bits below the MSB, with the MSB assumed to
always be one.
so, the AES polynomial would be specified as 0x1B with the top bit assumed to
be a 1 since it would only be used with XLEN=8.

In either case, having both degree and reducing polynomials as inputs as we do
currently seems quite suboptimal.

If this sounds good, I'll make the changes needed to have the reducing
polynomial as an input, and degree derived from it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list