@@ -320,25 +320,28 @@ struct FuzzOp {
320
320
}
321
321
};
322
322
" + & [
323
- ( 16 , "APFloat::IEEEhalf()" ) ,
324
- ( 32 , "APFloat::IEEEsingle()" ) ,
325
- ( 64 , "APFloat::IEEEdouble()" ) ,
326
- ( 128 , "APFloat::IEEEquad()" ) ,
327
- ( 16 , "APFloat::BFloat()" ) ,
328
- ( 80 , "APFloat::x87DoubleExtended()" ) ,
323
+ ( 16 , "IEEEhalf" ) ,
324
+ ( 32 , "IEEEsingle" ) ,
325
+ ( 64 , "IEEEdouble" ) ,
326
+ ( 128 , "IEEEquad" ) ,
327
+ ( 16 , "BFloat" ) ,
328
+ ( 8 , "Float8E5M2" ) ,
329
+ ( 8 , "Float8E4M3FN" ) ,
330
+ ( 80 , "x87DoubleExtended" ) ,
329
331
]
330
332
. into_iter ( )
331
- . map ( |( w, cxx_apf_semantics) | {
332
- let ( name_prefix, uint_width) = match w {
333
- 16 if cxx_apf_semantics. contains ( "BFloat" ) => ( "BrainF" , 16 ) ,
334
- 80 => ( "X87_F" , 128 ) ,
335
- _ => ( "IEEE" , w) ,
333
+ . map ( |( w, cxx_apf_semantics) : ( usize , _ ) | {
334
+ let uint_width = w. next_power_of_two ( ) ;
335
+ let name = match ( w, cxx_apf_semantics) {
336
+ ( 16 , "BFloat" ) => "BrainF16" . into ( ) ,
337
+ ( 8 , s) if s. starts_with ( "Float8" ) => s. replace ( "Float8" , "F8" ) ,
338
+ ( 80 , "x87DoubleExtended" ) => "X87_F80" . into ( ) ,
339
+ _ => {
340
+ assert ! ( cxx_apf_semantics. starts_with( "IEEE" ) ) ;
341
+ format ! ( "IEEE{w}" )
342
+ }
336
343
} ;
337
- let name = format ! ( "{name_prefix}{w}" ) ;
338
- let exported_symbol = format ! (
339
- "cxx_apf_fuzz_eval_op_{}{w}" ,
340
- name_prefix. to_ascii_lowercase( )
341
- ) ;
344
+ let exported_symbol = format ! ( "cxx_apf_fuzz_eval_op_{}" , name. to_ascii_lowercase( ) ) ;
342
345
exported_symbols. push ( exported_symbol. clone ( ) ) ;
343
346
let uint = format ! ( "uint{uint_width}_t" ) ;
344
347
format ! (
@@ -367,7 +370,7 @@ struct __attribute__((packed)) {name} {{
367
370
> words;
368
371
for(int i = 0; i < {w}; i += APInt::APINT_BITS_PER_WORD)
369
372
words[i / APInt::APINT_BITS_PER_WORD] = bits >> i;
370
- return APFloat({cxx_apf_semantics}, APInt({w}, words));
373
+ return APFloat(APFloat:: {cxx_apf_semantics}() , APInt({w}, words));
371
374
}}
372
375
}};
373
376
extern "C" {{
0 commit comments