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

Fixes and missing operator implementations for btorsim #25

Merged
merged 5 commits into from
Aug 7, 2024

Conversation

Ferdi265
Copy link
Contributor

@Ferdi265 Ferdi265 commented May 20, 2024

This PR implements the missing operations iff, rol, ror, and smod in btorsim and fixes the implementation for sra.

Btorsim already has an implementation for iff, but it wasn't marked as implemented.

Implement rol and ror by delegating to sll and srl and or-ing the results together.

Smod implementation taken from boolector (src/btorexp.c:1528)

The previous sra implementation wasn't working for negative inputs. The implementation was extracting the wrong sign bit (from b instead of a) and also accidently forgot to use it in the conditional, and used not_a instead.

This fixes #22, fixes #23, and fixes #24

Ferdi265 added 3 commits May 20, 2024 18:59
Btorsim already has an implementation for iff, but it wasn't marked as
implemented.

Signed-off-by: Ferdinand Bachmann <[email protected]>
The previous sra implementation wasn't working for negative inputs.
The implementation was extracting the wrong sign bit (from b instead of
a) and also accidently forgot to use it in the conditional, and used
not_a instead.

Signed-off-by: Ferdinand Bachmann <[email protected]>
This is a simple implementation delegating to sll and srl and or-ing the
results together

Signed-off-by: Ferdinand Bachmann <[email protected]>
Smod implementation taken from boolector (src/btorexp.c:1528)

Signed-off-by: Ferdinand Bachmann <[email protected]>
@Ferdi265
Copy link
Contributor Author

sorry for the many edits to this PR yesterday; should be ready for review now

@mpreiner
Copy link
Contributor

mpreiner commented Aug 6, 2024

@Ferdi265 Thanks a lot for the additions/fixes! Sorry that it took so long for reviewing the PR.

Copy link
Contributor

@mpreiner mpreiner left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mpreiner mpreiner merged commit 44bcadb into hwmcc:master Aug 7, 2024
3 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
2 participants