Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cowardsa
Copy link
Contributor

A circuit computing a*a can be constructed that is far more efficient than a generic multiplier by exploiting correlation in the partial product array. For example:

%0:4 = datapath.partial_product %a, %a : (i4, i4) -> (i4, i4, i4, i4)

Corresponds to a partial product array that can be simplified without using any logic to construct an upper-triangular partial product array as shown below (where we show the whole array before truncating to 4-bit rows):

   0    0    0 a0a3 a0a2 a0a1 a0a0
   0    0 a1a3 a1a2 a1a1 a1a0    0
   0 a2a3 a2a2 a2a1 a2a0    0    0 
a3a3 a3a2 a3a1 a3a0    0    0    0  
   0    0 a0a3 a0a2 a0a1    0   a0
   0 a1a3 a1a2    0   a1    0    0
a2a3    0   a2    0    0    0    0 
  a3    0    0    0    0    0    0

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool!

@cowardsa cowardsa merged commit be4ffb6 into llvm:main Sep 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants