@@ -184,99 +184,54 @@ unsignedbv_typet char32_t_type()
184
184
185
185
bitvector_typet float_type ()
186
186
{
187
- if (config.ansi_c .use_fixed_for_float )
188
- {
189
- fixedbv_typet result;
190
- result.set_width (config.ansi_c .single_width );
191
- result.set_integer_bits (config.ansi_c .single_width /2 );
192
- result.set (ID_C_c_type, ID_float);
193
- return result;
194
- }
195
- else
196
- {
197
- floatbv_typet result=
198
- ieee_float_spect::single_precision ().to_type ();
199
- result.set (ID_C_c_type, ID_float);
200
- return result;
201
- }
187
+ floatbv_typet result=
188
+ ieee_float_spect::single_precision ().to_type ();
189
+ result.set (ID_C_c_type, ID_float);
190
+ return result;
202
191
}
203
192
204
193
bitvector_typet double_type ()
205
194
{
206
- if (config.ansi_c .use_fixed_for_float )
207
- {
208
- fixedbv_typet result;
209
- result.set_width (config.ansi_c .double_width );
210
- result.set_integer_bits (config.ansi_c .double_width /2 );
211
- result.set (ID_C_c_type, ID_double);
212
- return result;
213
- }
214
- else
215
- {
216
- floatbv_typet result=
217
- ieee_float_spect::double_precision ().to_type ();
218
- result.set (ID_C_c_type, ID_double);
219
- return result;
220
- }
195
+ floatbv_typet result=
196
+ ieee_float_spect::double_precision ().to_type ();
197
+ result.set (ID_C_c_type, ID_double);
198
+ return result;
221
199
}
222
200
223
201
bitvector_typet long_double_type ()
224
202
{
225
- if (config.ansi_c .use_fixed_for_float )
203
+ floatbv_typet result;
204
+ if (config.ansi_c .long_double_width ==128 )
205
+ result=ieee_float_spect::quadruple_precision ().to_type ();
206
+ else if (config.ansi_c .long_double_width ==64 )
207
+ result=ieee_float_spect::double_precision ().to_type ();
208
+ else if (config.ansi_c .long_double_width ==80 )
226
209
{
227
- fixedbv_typet result;
228
- result.set_width (config.ansi_c .long_double_width );
229
- result.set_integer_bits (config.ansi_c .long_double_width /2 );
230
- result.set (ID_C_c_type, ID_long_double);
231
- return result;
210
+ // x86 extended precision has 80 bits in total, and
211
+ // deviating from IEEE, does not use a hidden bit.
212
+ // We use the closest we have got, but the below isn't accurate.
213
+ result=ieee_float_spect (63 , 15 ).to_type ();
232
214
}
233
- else
215
+ else if (config. ansi_c . long_double_width == 96 )
234
216
{
235
- floatbv_typet result;
236
- if (config.ansi_c .long_double_width ==128 )
237
- result=ieee_float_spect::quadruple_precision ().to_type ();
238
- else if (config.ansi_c .long_double_width ==64 )
239
- result=ieee_float_spect::double_precision ().to_type ();
240
- else if (config.ansi_c .long_double_width ==80 )
241
- {
242
- // x86 extended precision has 80 bits in total, and
243
- // deviating from IEEE, does not use a hidden bit.
244
- // We use the closest we have got, but the below isn't accurate.
245
- result=ieee_float_spect (63 , 15 ).to_type ();
246
- }
247
- else if (config.ansi_c .long_double_width ==96 )
248
- {
249
- result=ieee_float_spect (80 , 15 ).to_type ();
250
- // not quite right. The extra bits beyond 80 are usually padded.
251
- }
252
- else
253
- INVARIANT (false , " width of long double" );
254
-
255
- result.set (ID_C_c_type, ID_long_double);
256
-
257
- return result;
217
+ result=ieee_float_spect (80 , 15 ).to_type ();
218
+ // not quite right. The extra bits beyond 80 are usually padded.
258
219
}
220
+ else
221
+ INVARIANT (false , " width of long double" );
222
+
223
+ result.set (ID_C_c_type, ID_long_double);
224
+
225
+ return result;
259
226
}
260
227
261
228
bitvector_typet gcc_float128_type ()
262
229
{
263
230
// not same as long double!
264
-
265
- if (config.ansi_c .use_fixed_for_float )
266
- {
267
- fixedbv_typet result;
268
- result.set_width (128 );
269
- result.set_integer_bits (128 /2 );
270
- result.set (ID_C_c_type, ID_gcc_float128);
271
- return result;
272
- }
273
- else
274
- {
275
- floatbv_typet result=
276
- ieee_float_spect::quadruple_precision ().to_type ();
277
- result.set (ID_C_c_type, ID_gcc_float128);
278
- return result;
279
- }
231
+ floatbv_typet result=
232
+ ieee_float_spect::quadruple_precision ().to_type ();
233
+ result.set (ID_C_c_type, ID_gcc_float128);
234
+ return result;
280
235
}
281
236
282
237
signedbv_typet pointer_diff_type ()
0 commit comments