Re: [PATCH v4 bpf-next 1/2] bpf: improve the general precision of tnum_mul

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/08/25 00:07, Eduard Zingerman wrote:
Nit: The above comment is good for commit message but not for the code itself.
      Imo, commit in the code should concentrate on the concrete mechanics.
      E.g. you had a nice example in the readme for improved-tnum-mul.
      So, maybe change to something like below?

      /*
       * Perform long multiplication, iterating through the trits in a:
       * - if LSB(a) is a known 0, keep current accumulator
       * - if LSB(a) is a known 1, add b to current accumulator
       * - if LSB(a) is unknown, take a union of the above cases.
       *
       * For example:
       *
       *               acc_0:	    acc_1:	
       *               		   	
       *     11 *  ->      11 *	->      11 *  -> union(0011, 1001) == x0x1
       *     x1	          01	        11	
       * ------	      ------	    ------	
       *     11	          11	        11	
       *    xx	         00	       11	
       * ------	      ------	    ------	
       *   ????	        0011	      1001
       */
I really like this. Feel free to make this change, or just let me know if I should do it.

--
Nandakumar





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux