summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2022-01-27 20:55:08 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2022-01-27 20:55:08 +0100
commit74e6e3623f1c2f9abab009d6b2158d12199709ad (patch)
treeb93ea8e58205f55e61cdb32ea7d03452ad3abb1d /src
parentMerge pull request #7783 from lioncash/abi-cexpr (diff)
downloadyuzu-74e6e3623f1c2f9abab009d6b2158d12199709ad.tar
yuzu-74e6e3623f1c2f9abab009d6b2158d12199709ad.tar.gz
yuzu-74e6e3623f1c2f9abab009d6b2158d12199709ad.tar.bz2
yuzu-74e6e3623f1c2f9abab009d6b2158d12199709ad.tar.lz
yuzu-74e6e3623f1c2f9abab009d6b2158d12199709ad.tar.xz
yuzu-74e6e3623f1c2f9abab009d6b2158d12199709ad.tar.zst
yuzu-74e6e3623f1c2f9abab009d6b2158d12199709ad.zip
Diffstat (limited to 'src')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp
index 78869601f..4851b0b8d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp
@@ -57,16 +57,6 @@ void TranslatorVisitor::VMNMX(u64 insn) {
if (vmnmx.sat != 0) {
throw NotImplementedException("VMNMX SAT");
}
- // Selectors were shown to default to 2 in unit tests
- if (vmnmx.src_a_selector != 2) {
- throw NotImplementedException("VMNMX Selector {}", vmnmx.src_a_selector.Value());
- }
- if (vmnmx.src_b_selector != 2) {
- throw NotImplementedException("VMNMX Selector {}", vmnmx.src_b_selector.Value());
- }
- if (vmnmx.src_a_width != VideoWidth::Word) {
- throw NotImplementedException("VMNMX Source Width {}", vmnmx.src_a_width.Value());
- }
const bool is_b_imm{vmnmx.is_src_b_reg == 0};
const IR::U32 src_a{GetReg8(insn)};
@@ -76,10 +66,14 @@ void TranslatorVisitor::VMNMX(u64 insn) {
const VideoWidth a_width{vmnmx.src_a_width};
const VideoWidth b_width{GetVideoSourceWidth(vmnmx.src_b_width, is_b_imm)};
+ const u32 a_selector{static_cast<u32>(vmnmx.src_a_selector)};
+ // Immediate values can't have a selector
+ const u32 b_selector{is_b_imm ? 0U : static_cast<u32>(vmnmx.src_b_selector)};
+
const bool src_a_signed{vmnmx.src_a_sign != 0};
const bool src_b_signed{vmnmx.src_b_sign != 0};
- const IR::U32 op_a{ExtractVideoOperandValue(ir, src_a, a_width, 0, src_a_signed)};
- const IR::U32 op_b{ExtractVideoOperandValue(ir, src_b, b_width, 0, src_b_signed)};
+ const IR::U32 op_a{ExtractVideoOperandValue(ir, src_a, a_width, a_selector, src_a_signed)};
+ const IR::U32 op_b{ExtractVideoOperandValue(ir, src_b, b_width, b_selector, src_b_signed)};
// First operation's sign is only dependent on operand b's sign
const bool op_1_signed{src_b_signed};