Skip to content

Introduce floatbv_rounding_mode(unsigned) #6288

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
Aug 13, 2021
Merged

Conversation

kroening
Copy link
Member

This introduces a function to produce the constant expression that is
consumed by the floatbv_* expressions as the rounding mode.

Using this function in ieee_floatt removes the dependency on c_types.h.

  • Each commit message has a non-empty body, explaining why the change was made.
  • 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.

Comment on lines 16 to 17
// the 32 bits are an arbitrary choice
return ::from_integer(rm, unsignedbv_typet(32));
Copy link
Collaborator

@tautschnig tautschnig Aug 11, 2021

Choose a reason for hiding this comment

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

Shouldn't the comment also clarify that the type needs to be the same as that of the __CPROVER_rounding_mode symbol (which, actually, seems to be a signed int)? Edit: no, it doesn't matter, float_utilst::set_rounding_mode will create constants of the appropriate size.

@kroening kroening force-pushed the floatbv_rounding_mode branch from cb3a930 to f1bf2e6 Compare August 11, 2021 11:24
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

I'd prefer using an integer of minimal size of a fixed-32-bits one, but likely this won't matter much.

@tautschnig tautschnig assigned kroening and unassigned tautschnig Aug 11, 2021
@tautschnig
Copy link
Collaborator

@kroening I believe tests would pass after a rebase.

This introduces a function to produce the constant expression that is
consumed by the floatbv_* expressions as the rounding mode.

Using this function in ieee_floatt removes the dependency on c_types.h.
@codecov
Copy link

codecov bot commented Aug 13, 2021

Codecov Report

Merging #6288 (bd9520c) into develop (8065a69) will decrease coverage by 0.00%.
The diff coverage is 90.90%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6288      +/-   ##
===========================================
- Coverage    75.97%   75.97%   -0.01%     
===========================================
  Files         1508     1509       +1     
  Lines       163380   163381       +1     
===========================================
- Hits        124131   124130       -1     
- Misses       39249    39251       +2     
Impacted Files Coverage Δ
...ensitivity/variable_sensitivity_dependence_graph.h 79.31% <ø> (ø)
src/util/floatbv_expr.cpp 0.00% <0.00%> (ø)
src/util/floatbv_expr.h 73.58% <ø> (ø)
src/util/ieee_float.cpp 88.01% <0.00%> (ø)
src/util/ieee_float.h 85.71% <ø> (ø)
...nsitivity/three_way_merge_abstract_interpreter.cpp 93.02% <91.17%> (ø)
src/analyses/ai.cpp 76.12% <91.66%> (ø)
src/analyses/ai.h 57.36% <100.00%> (ø)
...sensitivity/three_way_merge_abstract_interpreter.h 100.00% <100.00%> (ø)
...sitivity/variable_sensitivity_dependence_graph.cpp 84.58% <100.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 904a07d...bd9520c. Read the comment docs.

@kroening kroening merged commit 0bbbe19 into develop Aug 13, 2021
@kroening kroening deleted the floatbv_rounding_mode branch August 13, 2021 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants