From 5ebc538d7e7787f3b1b3022afe704a4599035afb Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 23 Mar 2020 14:38:14 +0300 Subject: [PATCH] Workaround for VS 16.5 Strange codegen bug didn't promote s32 to u64. --- appveyor.yml | 2 +- rpcs3/Emu/Cell/PPUTranslator.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ca92e05a2a..c42e94578f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: '{build}' -image: Previous Visual Studio 2019 +image: Visual Studio 2019 environment: QTDIR: C:\Qt\5.14\msvc2017_64 diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 257cb157cf..79d0f8774b 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -908,7 +908,7 @@ void PPUTranslator::VMADDFP(ppu_opcode_t op) SetVr(op.vd, m_ir->CreateCall(get_intrinsic(llvm::Intrinsic::fma), { acb[0], acb[1], acb[2] })); return; } - + // Emulated FMA via double precision auto a = get_vr(op.va); auto b = get_vr(op.vb); @@ -1797,7 +1797,8 @@ void PPUTranslator::ADDIS(ppu_opcode_t op) void PPUTranslator::BC(ppu_opcode_t op) { - const u64 target = (op.aa ? 0 : m_addr) + op.bt14; + const s32 bt14 = op.bt14; // Workaround for VS 16.5 + const u64 target = (op.aa ? 0 : m_addr) + bt14; if (op.aa && m_reloc) { @@ -1845,7 +1846,8 @@ void PPUTranslator::SC(ppu_opcode_t op) void PPUTranslator::B(ppu_opcode_t op) { - const u64 target = (op.aa ? 0 : m_addr) + op.bt24; + const s32 bt24 = op.bt24; // Workaround for VS 16.5 + const u64 target = (op.aa ? 0 : m_addr) + bt24; if (op.aa && m_reloc) {