Skip to content

Conversation

@cowardsa
Copy link
Contributor

Reduce the number of partial product bits generated using a classical sign-extension trick where repeated bits can be optimised away. Currently only implemented when the inputs to a partial product operator are zero-extended. Current folding mechanisms are unable to recognise the zero-padding in a single step (although canonicalization will incrementally strip away). The KnownBits analysis is able to recognise this at some efficiency penalty - although this could be improved using bounded depth traversal.

A future PR will exploit this simplified partial product array via timing driven compression and improve the algorithm further to detect sign-extended inputs.

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 really awesome! Could you add normal FileCheck tests and LEC for partial products with zero/sign extension?

@cowardsa
Copy link
Contributor Author

cowardsa commented Sep 1, 2025

Now with tests added :)

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.

Thanks, looks awesome!

@cowardsa cowardsa merged commit 646e116 into llvm:main Sep 2, 2025
7 checks passed
@cowardsa cowardsa deleted the coward/booth_encoding branch October 20, 2025 16:14
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