reduce RS for consistency in gfbtmadd
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 18 Mar 2022 02:48:52 +0000 (19:48 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 18 Mar 2022 02:48:52 +0000 (19:48 -0700)
openpower/sv/bitmanip.mdwn

index ab2c7e2a90c564f480252db741ccfc76ef547ba1..ad120459ef7ef9bae8fea1b8ae0e39a485ef9f07 100644 (file)
@@ -701,7 +701,8 @@ 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
+# use gfbmadd again since it reduces the result
+(RS) = gfbmadd(a, 1, c) # "a * 1 + c"
 ```
 
 ## `gfbinv` -- Binary Galois Field `GF(2^m)` Inverse