diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-03 03:43:11 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-03 04:25:40 +0100 |
commit | 0be835132cce4455f5b770bffb34dc0292432383 (patch) | |
tree | f4065462e4674a4d094eacd5895ef2dc6cea3b61 /src/video_core/shader | |
parent | Merge pull request #2074 from ReinUsesLisp/shader-ir-unify-offset (diff) | |
download | yuzu-0be835132cce4455f5b770bffb34dc0292432383.tar yuzu-0be835132cce4455f5b770bffb34dc0292432383.tar.gz yuzu-0be835132cce4455f5b770bffb34dc0292432383.tar.bz2 yuzu-0be835132cce4455f5b770bffb34dc0292432383.tar.lz yuzu-0be835132cce4455f5b770bffb34dc0292432383.tar.xz yuzu-0be835132cce4455f5b770bffb34dc0292432383.tar.zst yuzu-0be835132cce4455f5b770bffb34dc0292432383.zip |
Diffstat (limited to 'src/video_core/shader')
-rw-r--r-- | src/video_core/shader/decode/memory.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 4d075f088..63965525c 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp @@ -104,16 +104,27 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) { } case OpCode::Id::LD_L: { UNIMPLEMENTED_IF_MSG(instr.ld_l.unknown == 1, "LD_L Unhandled mode: {}", - static_cast<unsigned>(instr.ld_l.unknown.Value())); - - const Node index = Operation(OperationCode::IAdd, GetRegister(instr.gpr8), - Immediate(static_cast<s32>(instr.smem_imm))); - const Node lmem = GetLocalMemory(index); + static_cast<u32>(instr.ld_l.unknown.Value())); + + const auto GetLmem = [&](s32 offset) { + ASSERT(offset % 4 == 0); + const Node immediate_offset = Immediate(static_cast<s32>(instr.smem_imm) + offset); + const Node address = Operation(OperationCode::IAdd, NO_PRECISE, GetRegister(instr.gpr8), + immediate_offset); + return GetLocalMemory(address); + }; switch (instr.ldst_sl.type.Value()) { case Tegra::Shader::StoreType::Bytes32: - SetRegister(bb, instr.gpr0, lmem); + SetRegister(bb, instr.gpr0, GetLmem(0)); break; + case Tegra::Shader::StoreType::Bytes64: { + SetTemporal(bb, 0, GetLmem(0)); + SetTemporal(bb, 1, GetLmem(4)); + SetRegister(bb, instr.gpr0, GetTemporal(0)); + SetRegister(bb, instr.gpr0.Value() + 1, GetTemporal(1)); + break; + } default: UNIMPLEMENTED_MSG("LD_L Unhandled type: {}", static_cast<unsigned>(instr.ldst_sl.type.Value())); |