@@ -282,11 +282,14 @@ void float_bvt::rounding_mode_bitst::get(const exprt &rm)
282282 exprt round_to_minus_inf_const=
283283 from_integer (ieee_floatt::ROUND_TO_MINUS_INF, rm.type ());
284284 exprt round_to_zero_const=from_integer (ieee_floatt::ROUND_TO_ZERO, rm.type ());
285+ exprt round_to_away_const =
286+ from_integer (ieee_floatt::ROUND_TO_AWAY, rm.type ());
285287
286288 round_to_even=equal_exprt (rm, round_to_even_const);
287289 round_to_plus_inf=equal_exprt (rm, round_to_plus_inf_const);
288290 round_to_minus_inf=equal_exprt (rm, round_to_minus_inf_const);
289291 round_to_zero=equal_exprt (rm, round_to_zero_const);
292+ round_to_away = equal_exprt (rm, round_to_away_const);
290293}
291294
292295exprt float_bvt::sign_bit (const exprt &op)
@@ -1166,12 +1169,18 @@ exprt float_bvt::fraction_rounding_decision(
11661169 // round to zero
11671170 false_exprt round_to_zero;
11681171
1172+ // round to away
1173+ const auto round_to_away = or_exprt (rounding_bit, sticky_bit);
1174+
11691175 // now select appropriate one
1176+ // clang-format off
11701177 return if_exprt (rounding_mode_bits.round_to_even , round_to_even,
11711178 if_exprt (rounding_mode_bits.round_to_plus_inf , round_to_plus_inf,
11721179 if_exprt (rounding_mode_bits.round_to_minus_inf , round_to_minus_inf,
11731180 if_exprt (rounding_mode_bits.round_to_zero , round_to_zero,
1174- false_exprt ())))); // otherwise zero
1181+ if_exprt (rounding_mode_bits.round_to_away , round_to_away,
1182+ false_exprt ()))))); // otherwise zero
1183+ // clang-format off
11751184}
11761185
11771186void float_bvt::round_fraction (
0 commit comments