diff options
| author | 2021-04-09 23:41:27 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:26 -0400 | |
| commit | 5cd3d00167b17c1fe36f97da978a7024e93c14e7 (patch) | |
| tree | 6760b6db0913800643095ee8666dbbe985df861a /src/shader_recompiler/frontend | |
| parent | shader: Fix dangling labels (diff) | |
| download | yuzu-5cd3d00167b17c1fe36f97da978a7024e93c14e7.tar.gz yuzu-5cd3d00167b17c1fe36f97da978a7024e93c14e7.tar.xz yuzu-5cd3d00167b17c1fe36f97da978a7024e93c14e7.zip | |
shader: Fix FCMP immediate variant
Diffstat (limited to 'src/shader_recompiler/frontend')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp index e78e9c4e1..c02a40209 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp | |||
| @@ -42,7 +42,15 @@ void TranslatorVisitor::FCMP_cr(u64 insn) { | |||
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | void TranslatorVisitor::FCMP_imm(u64 insn) { | 44 | void TranslatorVisitor::FCMP_imm(u64 insn) { |
| 45 | FCMP(*this, insn, GetReg39(insn), GetFloatImm20(insn)); | 45 | union { |
| 46 | u64 raw; | ||
| 47 | BitField<20, 19, u64> value; | ||
| 48 | BitField<56, 1, u64> is_negative; | ||
| 49 | } const fcmp{insn}; | ||
| 50 | const u32 sign_bit{fcmp.is_negative != 0 ? (1U << 31) : 0}; | ||
| 51 | const u32 value{static_cast<u32>(fcmp.value) << 12}; | ||
| 52 | |||
| 53 | FCMP(*this, insn, ir.Imm32(value), GetFloatReg39(insn)); | ||
| 46 | } | 54 | } |
| 47 | 55 | ||
| 48 | } // namespace Shader::Maxwell | 56 | } // namespace Shader::Maxwell |