diff options
| author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-04-17 00:48:35 -0400 |
|---|---|---|
| committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:28 -0400 |
| commit | be431f5ed080955cce358e9750347229b2bc9a04 (patch) | |
| tree | 6980191ce828379c3a0a16418539be676722de67 /src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp | |
| parent | 80940b17069f6baa733a9b572445b27bc7509137 (diff) | |
shader: Implement BFE and BFI CC
Fix two bugs in BFI.
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp index 0738ae7a6..9d5a87e52 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp @@ -18,10 +18,6 @@ void BFE(TranslatorVisitor& v, u64 insn, const IR::U32& src) { BitField<48, 1, u64> is_signed; } const bfe{insn}; - if (bfe.cc != 0) { - throw NotImplementedException("BFE CC"); - } - const IR::U32 offset{v.ir.BitFieldExtract(src, v.ir.Imm32(0), v.ir.Imm32(8), false)}; const IR::U32 count{v.ir.BitFieldExtract(src, v.ir.Imm32(8), v.ir.Imm32(8), false)}; @@ -53,6 +49,13 @@ void BFE(TranslatorVisitor& v, u64 insn, const IR::U32& src) { result = IR::U32{v.ir.Select(zero_count, zero, result)}; v.X(bfe.dest_reg, result); + + if (bfe.cc != 0) { + v.SetZFlag(v.ir.IEqual(result, zero)); + v.SetSFlag(v.ir.ILessThan(result, zero, true)); + v.ResetCFlag(); + v.ResetOFlag(); + } } } // Anonymous namespace |
