| 71 | } |
| 72 | |
| 73 | static 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 | |
| 85 | FloatConst::FloatConst(Type &type, string val, bool bit_value) |
| 86 | : Constant(type, bit_value ? int_to_readable_float(type, val) : val), |
no test coverage detected