From: Jacob Lifshay Date: Fri, 18 Mar 2022 02:46:44 +0000 (-0700) Subject: read all inputs before writing to any outputs X-Git-Tag: opf_rfc_ls005_v1~3018 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d55ca21896083a8f202917609e4e218737c1cc16;p=libreriscv.git read all inputs before writing to any outputs in case an input overlaps with an output register. --- diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 548d487bc..ab2c7e2a9 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -594,9 +594,13 @@ cltmadd RT, RA, RB, RC TODO: add link to explanation for where `RS` comes from. -``` -(RT) = RC ^ clmul((RA), (RB)) -(RS) = RA ^ RC +``` +a = (RA) +c = (RC) +# read all inputs before writing to any outputs in case +# an input overlaps with an output register. +(RT) = clmul(a, (RB)) ^ c +(RS) = a ^ c ``` ## `cldivrem` Carry-less Division and Remainder @@ -691,9 +695,13 @@ gfbtmadd RT, RA, RB, RC TODO: add link to explanation for where `RS` comes from. -``` -(RT) = gfbmadd((RA), (RB), (RC)) -(RS) = RA ^ RC +``` +a = (RA) +c = (RC) +# read all inputs before writing to any outputs in case +# an input overlaps with an output register. +(RT) = gfbmadd(a, (RB), c) +(RS) = a ^ c ``` ## `gfbinv` -- Binary Galois Field `GF(2^m)` Inverse