MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / int_to_readable_float

Function int_to_readable_float

ir/constant.cpp:73–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73static string int_to_readable_float(Type &type, const string &val) {
74 switch (type.getAsFloatType()->getFpType()) {
75 case FloatType::Float: return bits_to_float<unsigned, float>(type, val);
76 case FloatType::Double: return bits_to_float<uint64_t, double>(type, val);
77 case FloatType::Quad: return val;
78 case FloatType::Half:
79 case FloatType::BFloat: return to_hex(type, val);
80 case FloatType::Unknown: UNREACHABLE();
81 }
82 UNREACHABLE();
83}
84
85FloatConst::FloatConst(Type &type, string val, bool bit_value)
86 : Constant(type, bit_value ? int_to_readable_float(type, val) : val),

Callers 1

FloatConstMethod · 0.85

Calls 3

to_hexFunction · 0.85
getFpTypeMethod · 0.80
getAsFloatTypeMethod · 0.80

Tested by

no test coverage detected