Implement std::bit_cast<>

Partial implementation of std::bit_cast from C++20.
Also fix most strict-aliasing rule break warnings (gcc).
This commit is contained in:
Nekotekina 2019-06-02 00:12:17 +03:00
parent 790962425c
commit dfd50d0185
24 changed files with 145 additions and 176 deletions

View file

@ -34,7 +34,7 @@ void CgBinaryDisasm::AddCodeAsm(const std::string& code)
case RSX_FP_OPCODE_LOOP:
case RSX_FP_OPCODE_NOP:
case RSX_FP_OPCODE_REP:
case RSX_FP_OPCODE_RET:
case RSX_FP_OPCODE_RET:
m_dst_reg_name.clear();
op_name = rsx_fp_op_names[m_opcode] + std::string(dst.fp16 ? "H" : "R");
break;
@ -77,7 +77,7 @@ std::string CgBinaryDisasm::AddConstDisAsm()
const u32 z = GetData(data[2]);
const u32 w = GetData(data[3]);
return fmt::format("{0x%08x(%g), 0x%08x(%g), 0x%08x(%g), 0x%08x(%g)}", x, (float&)x, y, (float&)y, z, (float&)z, w, (float&)w);
return fmt::format("{0x%08x(%g), 0x%08x(%g), 0x%08x(%g), 0x%08x(%g)}", x, std::bit_cast<f32>(x), y, std::bit_cast<f32>(y), z, std::bit_cast<f32>(z), w, std::bit_cast<f32>(w));
}
std::string CgBinaryDisasm::AddTexDisAsm()