Skip to content

Conversation

@cowardsa
Copy link
Contributor

Following the work of Zimmerman we can implement expressions of the form: (a+b)*c, namely a multiplier where one of the operands is in a carry-save format. This can be useful if we want to multiply three numbers together for example.

Specifically we can use a special encoding to avoid computing the complete (carry-propagated) result of (a+b) before we start the multiplication. This PR adds the following operator:

%0:3 = datapath.pos_partial_product %a, %b, %c : (i3, i3, i3) -> (i3, i3, i3)

The PR includes lowerings to comb gates and to SMT for verification as well as canonicalization patterns.

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.

Looks awesome! Could you add LEC tests as well?

@cowardsa cowardsa merged commit da9a6d5 into llvm:main Sep 18, 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