diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-04-10 00:29:12 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:27 +0200 |
commit | 1be6705408d1a3454146c705fae3dc55031e966e (patch) | |
tree | 325133fcabd67f3e21fdb4096b5cc8c59875b7ad /src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp | |
parent | shader: Remove outdated comment in F2I (diff) | |
download | yuzu-1be6705408d1a3454146c705fae3dc55031e966e.tar yuzu-1be6705408d1a3454146c705fae3dc55031e966e.tar.gz yuzu-1be6705408d1a3454146c705fae3dc55031e966e.tar.bz2 yuzu-1be6705408d1a3454146c705fae3dc55031e966e.tar.lz yuzu-1be6705408d1a3454146c705fae3dc55031e966e.tar.xz yuzu-1be6705408d1a3454146c705fae3dc55031e966e.tar.zst yuzu-1be6705408d1a3454146c705fae3dc55031e966e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp index 914af010f..a2cd8d7c6 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp @@ -19,6 +19,7 @@ void ISET(TranslatorVisitor& v, u64 insn, const IR::U32& src_a) { BitField<43, 1, u64> x; BitField<44, 1, u64> bf; BitField<45, 2, BooleanOp> bop; + BitField<47, 1, u64> cc; BitField<48, 1, u64> is_signed; BitField<49, 3, CompareOp> compare_op; } const iset{insn}; @@ -38,12 +39,22 @@ void ISET(TranslatorVisitor& v, u64 insn, const IR::U32& src_a) { const IR::U32 one_mask{v.ir.Imm32(-1)}; const IR::U32 fp_one{v.ir.Imm32(0x3f800000)}; - const IR::U32 fail_result{v.ir.Imm32(0)}; + const IR::U32 zero{v.ir.Imm32(0)}; const IR::U32 pass_result{iset.bf == 0 ? one_mask : fp_one}; - - const IR::U32 result{v.ir.Select(bop_result, pass_result, fail_result)}; + const IR::U32 result{v.ir.Select(bop_result, pass_result, zero)}; v.X(iset.dest_reg, result); + if (iset.cc != 0) { + const IR::U1 is_zero{v.ir.IEqual(result, zero)}; + v.SetZFlag(is_zero); + if (iset.bf != 0) { + v.ResetSFlag(); + } else { + v.SetSFlag(v.ir.LogicalNot(is_zero)); + } + v.ResetCFlag(); + v.ResetOFlag(); + } } } // Anonymous namespace |