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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/util/ieee_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ class ieee_floatt
public:
// ROUND_TO_EVEN is also known as "round to nearest, ties to even", and
// is the IEEE default.
// ROUND_TO_AWAY is also known as "round to infinity".
// The numbering below is what x86 uses in the control word and
// what is recommended in C11 5.2.4.2.2
// what is recommended in C11 5.2.4.2.2.
// The numbering of ROUND_TO_AWAY is not specified in C11 5.2.4.2.2.
enum rounding_modet
{
ROUND_TO_EVEN=0, ROUND_TO_MINUS_INF=1,
ROUND_TO_PLUS_INF=2, ROUND_TO_ZERO=3,
UNKNOWN, NONDETERMINISTIC
ROUND_TO_EVEN = 0,
ROUND_TO_MINUS_INF = 1,
ROUND_TO_PLUS_INF = 2,
ROUND_TO_ZERO = 3,
ROUND_TO_AWAY = 4,
UNKNOWN,
NONDETERMINISTIC
};

// A helper to turn a rounding mode into a constant bitvector expression
Expand Down
Loading