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

Add IEEE 754 TiesToAway rounding mode #8515

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Add IEEE 754 TiesToAway rounding mode #8515

merged 1 commit into from
Feb 11, 2025

Conversation

kroening
Copy link
Member

This adds IEEE 754 TiesToAway rounding mode, which rounds away from zero in case of a tie.

  • 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.
  • 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.

@kroening kroening force-pushed the TiesToAway branch 3 times, most recently from 278c8af to 5e5f9ee Compare December 6, 2024 15:23
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 46.80851% with 25 lines in your changes missing coverage. Please review.

Project coverage is 79.14%. Comparing base (6957a04) to head (5c62ecc).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/solvers/smt2/smt2_conv.cpp 0.00% 8 Missing ⚠️
src/util/ieee_float.cpp 14.28% 6 Missing ⚠️
src/solvers/smt2/smt2_parser.cpp 33.33% 4 Missing ⚠️
src/solvers/floatbv/float_bv.cpp 66.66% 3 Missing ⚠️
src/solvers/floatbv/float_utils.h 72.72% 3 Missing ⚠️
src/solvers/floatbv/float_utils.cpp 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8515      +/-   ##
===========================================
- Coverage    79.60%   79.14%   -0.46%     
===========================================
  Files         1733     1733              
  Lines       197358   198512    +1154     
  Branches     18165    18173       +8     
===========================================
+ Hits        157111   157119       +8     
- Misses       40247    41393    +1146     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kroening kroening force-pushed the TiesToAway branch 2 times, most recently from 7849525 to e4647d8 Compare February 5, 2025 10:43
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.

Looks good except the below piece that I believe to be wrong.

// TODO: add some kind of error checking here
out << "roundTowardZero";
out << "roundTowardAway";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be RoundNearestTiesToAway?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, fixed.

This adds IEEE 754 TiesToAway rounding mode, which rounds away from zero in
case of a tie.

The rounding mode is added to three distinct implementations:

1. The implementation for constants, in util/ieee_float.h

2. The implementation that creates a bit-level encoding, in
src/solvers/floatbv/float_utils.h.

3. The implementation that creates a word-level encoding, in
solvers/floatbv/float_bv.cpp.
@kroening kroening merged commit ba3b018 into develop Feb 11, 2025
39 of 41 checks passed
@kroening kroening deleted the TiesToAway branch February 11, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants