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

compiler-rt: alu: add absolute for i8 #132

Merged
merged 1 commit into from
Jan 24, 2025
Merged

compiler-rt: alu: add absolute for i8 #132

merged 1 commit into from
Jan 24, 2025

Conversation

wzmuda
Copy link
Contributor

@wzmuda wzmuda commented Jan 24, 2025

Summary

Implement the following polyfill:

  • __llvm_abs_i8_i8

Details

Since the absolute value was already calculated in a few places, use the new polyfill there. Also refactor two's complement calculation to be an utility function since it's now used in abs and sdiv.

Checklist

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

@wzmuda wzmuda self-assigned this Jan 24, 2025
@wzmuda wzmuda requested a review from a team as a code owner January 24, 2025 00:25
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.

One concern that I'd like to see addressed before I give my approval.

compiler-rt/src/utils.cairo Outdated Show resolved Hide resolved
Implement the following polyfill:
- `__llvm_abs_i8_i8`

Since the absolute value was already calculated in a few places, use the
new polyfill there. Also refactor two's complement calculation to be an
utility function since it's now used in abs and sdiv.

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

Okay, LGTM!

@wzmuda wzmuda merged commit 57f5726 into main Jan 24, 2025
10 checks passed
@wzmuda wzmuda deleted the wz/8b-arith-abs branch January 24, 2025 23:28
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