Skip to content

Remove vectors: Boolean expressions do not require signed bitvectors #7234

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

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

tautschnig
Copy link
Collaborator

Any bitvector type will do as all we need to produce is a constant with all bits set (see
https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html: "Vectors are compared element-wise producing 0 when comparison is false and -1 (constant of the appropriate type where all bits are set) otherwise.").

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig added aws Bugs or features of importance to AWS CBMC users Kani Bugs or features of importance to Kani Rust Verifier labels Oct 12, 2022
@tautschnig tautschnig marked this pull request as ready for review October 12, 2022 19:04
@kroening kroening changed the title Remove vectors: Boolean expressions do not required signed bitvectors Remove vectors: Boolean expressions do not require signed bitvectors Oct 12, 2022
@kroening
Copy link
Member

The from_integer(-1, subtype); works on unsigned bitvectors as well (it's designed to), so dropping the precondition may be the right thing to do.

@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Base: 77.99% // Head: 77.99% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (9baef8f) compared to base (f8e6230).
Patch coverage: 94.20% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7234      +/-   ##
===========================================
- Coverage    77.99%   77.99%   -0.01%     
===========================================
  Files         1619     1619              
  Lines       187185   187184       -1     
===========================================
- Hits        146000   145999       -1     
  Misses       41185    41185              
Impacted Files Coverage Δ
...src/java_bytecode/java_bytecode_convert_method.cpp 97.69% <ø> (ø)
jbmc/src/java_bytecode/java_bytecode_language.cpp 92.81% <ø> (ø)
jbmc/src/java_bytecode/java_string_literals.cpp 94.54% <ø> (ø)
jbmc/unit/java-testing-utils/require_type.cpp 92.18% <75.00%> (ø)
jbmc/src/java_bytecode/java_types.cpp 95.13% <88.46%> (ø)
jbmc/src/java_bytecode/assignments_from_json.cpp 97.28% <100.00%> (ø)
.../src/java_bytecode/java_bytecode_convert_class.cpp 94.18% <100.00%> (ø)
...src/java_bytecode/java_bytecode_typecheck_expr.cpp 100.00% <100.00%> (ø)
...src/java_bytecode/java_bytecode_typecheck_type.cpp 96.00% <100.00%> (ø)
jbmc/src/java_bytecode/java_object_factory.cpp 94.40% <100.00%> (ø)
... and 15 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tautschnig tautschnig force-pushed the bugfixes/vector-unsigned branch from cef6c50 to 597aed1 Compare October 12, 2022 20:53
@tautschnig
Copy link
Collaborator Author

The from_integer(-1, subtype); works on unsigned bitvectors as well (it's designed to), so dropping the precondition may be the right thing to do.

Done.

Any bitvector type will do as all we need to produce is a constant with
all bits set (see
https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html: "Vectors are
compared element-wise producing 0 when comparison is false and -1
(constant of the appropriate type where all bits are set) otherwise.").
@tautschnig tautschnig force-pushed the bugfixes/vector-unsigned branch from 597aed1 to 9baef8f Compare October 12, 2022 21:14
@kroening kroening merged commit 40e0123 into diffblue:develop Oct 13, 2022
@tautschnig tautschnig deleted the bugfixes/vector-unsigned branch October 13, 2022 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users Kani Bugs or features of importance to Kani Rust Verifier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants