Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RT: ALU: i8 multiplication #120

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

RT: ALU: i8 multiplication #120

wants to merge 3 commits into from

Conversation

wzmuda
Copy link
Contributor

@wzmuda wzmuda commented Jan 6, 2025

Summary

Add the following polyfills:

  • __llvm_mul_i8_i8,
  • __llvm_smul_with_overflow_i8_i8
  • __llvm_umul_with_overflow_i8_i8

Details

Checklist

  • Code is formatted by Rustfmt or scarb fmt.
  • Documentation has been updated if necessary.

@wzmuda wzmuda force-pushed the wz/8b-arith-mul branch 2 times, most recently from 69de2e1 to d650038 Compare January 7, 2025 23:57
@wzmuda wzmuda force-pushed the wz/8b-arith-mul branch 4 times, most recently from c4370c6 to 96e7062 Compare January 13, 2025 23:28
@wzmuda wzmuda marked this pull request as ready for review January 13, 2025 23:33
@wzmuda wzmuda requested a review from a team as a code owner January 13, 2025 23:33
@ktemkin
Copy link
Collaborator

ktemkin commented Jan 14, 2025

Is this ready for review / seems to be working, now? It looks that way, but I want to be sure given its history.

(In the future, can we either use draft PRs or provide a "requires changes" self-review once we know something's not ready for merge, so we can avoid the confusing prior state this had?)

@wzmuda
Copy link
Contributor Author

wzmuda commented Jan 14, 2025

@ktemkin it is ready and it was a draft all the time I was polishing the logic. I marked it as ready yesterday when I fixed the code.

Copy link
Collaborator

@iamrecursion iamrecursion left a comment

Choose a reason for hiding this comment

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

Looks great! Only thing that might be nice to see is a design-level doc that explains the sign extension and why it is necessary, for those who come and look at this in the future and also might get caught up on it.

wzmuda and others added 3 commits January 14, 2025 23:05
Implement the following polyfill:
- `__llvm_mul_i8_u8`

Signed-off-by: Wojciech Zmuda <[email protected]>
Implement the following polyfill:
- `__llvm_umul_with_overflow_i8_i8`

Signed-off-by: Wojciech Zmuda <[email protected]>
Implement the following polyfill:
- `__llvm_smul_with_overflow_i8_i8`

Signed-off-by: Wojciech Zmuda <[email protected]>
Co-authored-by: Kate Temkin <[email protected]>
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.

3 participants