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

Converting bit-operations to arithmetic #74

Closed
ThomasHaas opened this issue Jul 31, 2021 · 4 comments
Closed

Converting bit-operations to arithmetic #74

ThomasHaas opened this issue Jul 31, 2021 · 4 comments

Comments

@ThomasHaas
Copy link
Collaborator

Context: Some benchmarks involve a few bit-operations, potentially introduced through the compiler or by manual optimization. This can include xors to negate booleans (i1 Variables in LLVM) or shifts to perform multiplication.

Problem: Mixing the theories of bit-vectors and integers may slow down the solver.

Solution: If possible, bit-operations should be converted to integer or boolean operations if possible.

  • xor on i1 variables -> boolean negation (already implemented)
  • left-shifts -> multiplication
  • bitwise or/and on i1 variables -> boolean or/and

Example: bresenham's algorithm uses multiplication by 2. The compiler tends to replace this by bit-shifts, causing mixing of theories.

@hernanponcedeleon
Copy link
Owner

Does this one make sense still?

@ThomasHaas
Copy link
Collaborator Author

Yes, if we want to keep supporting integer encoding.

@hernanponcedeleon
Copy link
Owner

Isn't this the same as #538?

@ThomasHaas
Copy link
Collaborator Author

It's not the same, but heavily outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants