@@ -282,11 +282,14 @@ void float_bvt::rounding_mode_bitst::get(const exprt &rm)
282
282
exprt round_to_minus_inf_const=
283
283
from_integer (ieee_floatt::ROUND_TO_MINUS_INF, rm.type ());
284
284
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 ());
285
287
286
288
round_to_even=equal_exprt (rm, round_to_even_const);
287
289
round_to_plus_inf=equal_exprt (rm, round_to_plus_inf_const);
288
290
round_to_minus_inf=equal_exprt (rm, round_to_minus_inf_const);
289
291
round_to_zero=equal_exprt (rm, round_to_zero_const);
292
+ round_to_away = equal_exprt (rm, round_to_away_const);
290
293
}
291
294
292
295
exprt float_bvt::sign_bit (const exprt &op)
@@ -1166,12 +1169,18 @@ exprt float_bvt::fraction_rounding_decision(
1166
1169
// round to zero
1167
1170
false_exprt round_to_zero;
1168
1171
1172
+ // round to away
1173
+ const auto round_to_away = or_exprt (rounding_bit, sticky_bit);
1174
+
1169
1175
// now select appropriate one
1176
+ // clang-format off
1170
1177
return if_exprt (rounding_mode_bits.round_to_even , round_to_even,
1171
1178
if_exprt (rounding_mode_bits.round_to_plus_inf , round_to_plus_inf,
1172
1179
if_exprt (rounding_mode_bits.round_to_minus_inf , round_to_minus_inf,
1173
1180
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
1175
1184
}
1176
1185
1177
1186
void float_bvt::round_fraction (
0 commit comments