@@ -92,8 +92,7 @@ exprt float_bvt::convert(const exprt &expr) const
9292 return nil_exprt{};
9393 }
9494
95- return extractbits_exprt{
96- to_typecast_expr (expr).op (), dest_type.get_width () - 1 , 0 , dest_type};
95+ return extractbits_exprt{to_typecast_expr (expr).op (), 0 , dest_type};
9796 }
9897 else if (expr.id ()==ID_floatbv_plus)
9998 {
@@ -669,12 +668,11 @@ exprt float_bvt::limit_distance(
669668 return dist;
670669
671670 const extractbits_exprt upper_bits (
672- dist, dist_width - 1 , nb_bits, unsignedbv_typet (dist_width - nb_bits));
671+ dist, nb_bits, unsignedbv_typet (dist_width - nb_bits));
673672 const equal_exprt upper_bits_zero (
674673 upper_bits, from_integer (0 , upper_bits.type ()));
675674
676- const extractbits_exprt lower_bits (
677- dist, nb_bits - 1 , 0 , unsignedbv_typet (nb_bits));
675+ const extractbits_exprt lower_bits (dist, 0 , unsignedbv_typet (nb_bits));
678676
679677 return if_exprt (
680678 upper_bits_zero,
@@ -924,19 +922,15 @@ exprt float_bvt::get_exponent(
924922 const exprt &src,
925923 const ieee_float_spect &spec)
926924{
927- return extractbits_exprt (
928- src, spec.f +spec.e -1 , spec.f ,
929- unsignedbv_typet (spec.e ));
925+ return extractbits_exprt (src, spec.f , unsignedbv_typet (spec.e ));
930926}
931927
932928// / Gets the fraction without hidden bit in a floating-point bit-vector src
933929exprt float_bvt::get_fraction (
934930 const exprt &src,
935931 const ieee_float_spect &spec)
936932{
937- return extractbits_exprt (
938- src, spec.f -1 , 0 ,
939- unsignedbv_typet (spec.f ));
933+ return extractbits_exprt (src, 0 , unsignedbv_typet (spec.f ));
940934}
941935
942936exprt float_bvt::isnan (
@@ -975,10 +969,7 @@ void float_bvt::normalization_shift(
975969
976970 // check if first 'distance'-many bits are zeros
977971 const extractbits_exprt prefix (
978- fraction,
979- fraction_bits - 1 ,
980- fraction_bits - distance,
981- unsignedbv_typet (distance));
972+ fraction, fraction_bits - distance, unsignedbv_typet (distance));
982973 const equal_exprt prefix_is_zero (prefix, from_integer (0 , prefix.type ()));
983974
984975 // If so, shift the zeros out left by 'distance'.
@@ -1147,7 +1138,7 @@ exprt float_bvt::fraction_rounding_decision(
11471138 // We keep most-significant bits, and thus the tail is made
11481139 // of least-significant bits.
11491140 const extractbits_exprt tail (
1150- fraction, extra_bits - 2 , 0 , unsignedbv_typet (extra_bits - 2 + 1 ));
1141+ fraction, 0 , unsignedbv_typet (extra_bits - 2 + 1 ));
11511142 sticky_bit=notequal_exprt (tail, from_integer (0 , tail.type ()));
11521143 }
11531144
@@ -1216,9 +1207,8 @@ void float_bvt::round_fraction(
12161207 fraction_size, result.sign , result.fraction , rounding_mode_bits);
12171208
12181209 // chop off all the extra bits
1219- result.fraction =extractbits_exprt (
1220- result.fraction , result_fraction_size-1 , extra_bits,
1221- unsignedbv_typet (fraction_size));
1210+ result.fraction = extractbits_exprt (
1211+ result.fraction , extra_bits, unsignedbv_typet (fraction_size));
12221212
12231213#if 0
12241214 // *** does not catch when the overflow goes subnormal -> normal ***
@@ -1306,8 +1296,8 @@ void float_bvt::round_exponent(
13061296 else // exponent gets smaller -- chop off top bits
13071297 {
13081298 exprt old_exponent=result.exponent ;
1309- result.exponent =
1310- extractbits_exprt (result.exponent , spec. e - 1 , 0 , signedbv_typet (spec.e ));
1299+ result.exponent =
1300+ extractbits_exprt (result.exponent , 0 , signedbv_typet (spec.e ));
13111301
13121302 // max_exponent is the maximum representable
13131303 // i.e. 1 higher than the maximum possible for a normal number
@@ -1374,10 +1364,8 @@ float_bvt::biased_floatt float_bvt::bias(
13741364 const extractbit_exprt hidden_bit (src.fraction , spec.f );
13751365 const not_exprt denormal (hidden_bit);
13761366
1377- result.fraction =
1378- extractbits_exprt (
1379- src.fraction , spec.f -1 , 0 ,
1380- unsignedbv_typet (spec.f ));
1367+ result.fraction =
1368+ extractbits_exprt (src.fraction , 0 , unsignedbv_typet (spec.f ));
13811369
13821370 // make exponent zero if its denormal
13831371 // (includes zero)
@@ -1490,7 +1478,7 @@ exprt float_bvt::sticky_right_shift(
14901478 exprt lost_bits;
14911479
14921480 if (d<=width)
1493- lost_bits= extractbits_exprt (result, d- 1 , 0 , unsignedbv_typet (d));
1481+ lost_bits = extractbits_exprt (result, 0 , unsignedbv_typet (d));
14941482 else
14951483 lost_bits=result;
14961484
0 commit comments