[Libre-soc-bugs] [Bug 784] Implement cl* instructions for carry-less operations
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Tue Apr 5 21:18:45 BST 2022
https://bugs.libre-soc.org/show_bug.cgi?id=784
--- Comment #19 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #18)
>
> that could be achieved with a comment (not too big! the code's really
> elegant and small without the case statement. something like:
>
> """
> for i in range(self.width):
> for each bit a[i] b[i] set addend1[i], addend2[i]
> case 1,1 both have no leading zeros so far, so set carry 1,1
> case 0/1 1/0 different number of leading zeros, so clear carry 0,0
> case 0,0 propagate results from lower bits, so set 1,0
>
> this is basically equivalent to: addend1 = a^b and addend2 = a|b
> """
>
> does that look reasonably obvious?
yes, except that the correct ops are XNOR and AND, not XOR and OR
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list