Hexadecimal floats for "perfect values" 0h42f60000 == 123; use bit_cast in compiler

This commit is contained in:
gingerBill
2018-02-25 15:09:16 +00:00
parent 27b7dc336a
commit d247ba4751
9 changed files with 70 additions and 54 deletions
+1 -1
View File
@@ -595,7 +595,7 @@ void ir_print_exact_value(irFileBuffer *f, irModule *m, ExactValue value, Type *
case ExactValue_Float: {
GB_ASSERT_MSG(is_type_float(type), "%s", type_to_string(type));
type = core_type(type);
u64 u = *cast(u64*)&value.value_float;
u64 u = bit_cast<u64>(value.value_float);
switch (type->Basic.kind) {
case Basic_f32:
// IMPORTANT NOTE(bill): LLVM requires all floating point constants to be