@@ -121,22 +121,29 @@ class ieee_floatt
121121 // what is recommended in C11 5.2.4.2.2
122122 enum rounding_modet
123123 {
124- ROUND_TO_EVEN=0 , ROUND_TO_MINUS_INF=1 ,
125- ROUND_TO_PLUS_INF=2 , ROUND_TO_ZERO=3 ,
126- UNKNOWN, NONDETERMINISTIC
124+ ROUND_TO_EVEN = 0 ,
125+ ROUND_TO_MINUS_INF = 1 ,
126+ ROUND_TO_PLUS_INF = 2 ,
127+ ROUND_TO_ZERO = 3 ,
128+ UNKNOWN,
129+ NONDETERMINISTIC,
130+ NOT_SET
127131 };
128132
129133 // A helper to turn a rounding mode into a constant bitvector expression
130134 static constant_exprt rounding_mode_expr (rounding_modet);
131135
132- rounding_modet rounding_mode;
136+ rounding_modet rounding_mode = rounding_modet::NOT_SET ;
133137
134138 ieee_float_spect spec;
135139
136- explicit ieee_floatt (const ieee_float_spect &_spec):
137- rounding_mode(ROUND_TO_EVEN),
138- spec(_spec), sign_flag(false ), exponent(0 ), fraction(0 ),
139- NaN_flag(false ), infinity_flag(false )
140+ explicit ieee_floatt (const ieee_float_spect &_spec)
141+ : spec(_spec),
142+ sign_flag(false ),
143+ exponent(0 ),
144+ fraction(0 ),
145+ NaN_flag(false ),
146+ infinity_flag(false )
140147 {
141148 }
142149
@@ -151,26 +158,47 @@ class ieee_floatt
151158 {
152159 }
153160
154- explicit ieee_floatt (const floatbv_typet &type):
155- rounding_mode(ROUND_TO_EVEN),
156- spec(ieee_float_spect(type)),
157- sign_flag(false ),
158- exponent(0 ),
159- fraction(0 ),
160- NaN_flag(false ),
161- infinity_flag(false )
161+ explicit ieee_floatt (const floatbv_typet &type)
162+ : spec(ieee_float_spect(type)),
163+ sign_flag(false ),
164+ exponent(0 ),
165+ fraction(0 ),
166+ NaN_flag(false ),
167+ infinity_flag(false )
162168 {
163169 }
164170
165- ieee_floatt ():
166- rounding_mode (ROUND_TO_EVEN),
167- sign_flag (false ), exponent(0 ), fraction(0 ),
168- NaN_flag (false ), infinity_flag(false )
171+ explicit ieee_floatt (
172+ const floatbv_typet &type,
173+ rounding_modet __rounding_mode)
174+ : rounding_mode(__rounding_mode),
175+ spec(ieee_float_spect(type)),
176+ sign_flag(false ),
177+ exponent(0 ),
178+ fraction(0 ),
179+ NaN_flag(false ),
180+ infinity_flag(false )
169181 {
170182 }
171183
172- explicit ieee_floatt (const constant_exprt &expr):
173- rounding_mode(ROUND_TO_EVEN)
184+ ieee_floatt ()
185+ : sign_flag(false ),
186+ exponent (0 ),
187+ fraction(0 ),
188+ NaN_flag(false ),
189+ infinity_flag(false )
190+ {
191+ }
192+
193+ explicit ieee_floatt (const constant_exprt &expr)
194+ {
195+ from_expr (expr);
196+ }
197+
198+ explicit ieee_floatt (
199+ const constant_exprt &expr,
200+ rounding_modet __rounding_mode)
201+ : rounding_mode(__rounding_mode)
174202 {
175203 from_expr (expr);
176204 }
0 commit comments