mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
Handle -1 as V_CMP_NE_U64 argument (#2919)
This commit is contained in:
parent
7334fb620b
commit
484fbcc320
1 changed files with 12 additions and 3 deletions
|
@ -989,13 +989,22 @@ void Translator::V_CMP_NE_U64(const GcnInst& inst) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const IR::U1 src0{get_src(inst.src[0])};
|
const IR::U1 src0{get_src(inst.src[0])};
|
||||||
ASSERT(inst.src[1].field == OperandField::ConstZero); // src0 != 0
|
auto op = [&inst, this](auto x) {
|
||||||
|
switch (inst.src[1].field) {
|
||||||
|
case OperandField::ConstZero:
|
||||||
|
return x;
|
||||||
|
case OperandField::SignedConstIntNeg:
|
||||||
|
return ir.LogicalNot(x);
|
||||||
|
default:
|
||||||
|
UNREACHABLE_MSG("unhandled V_CMP_NE_U64 source argument {}", u32(inst.src[1].field));
|
||||||
|
}
|
||||||
|
};
|
||||||
switch (inst.dst[1].field) {
|
switch (inst.dst[1].field) {
|
||||||
case OperandField::VccLo:
|
case OperandField::VccLo:
|
||||||
ir.SetVcc(src0);
|
ir.SetVcc(op(src0));
|
||||||
break;
|
break;
|
||||||
case OperandField::ScalarGPR:
|
case OperandField::ScalarGPR:
|
||||||
ir.SetThreadBitScalarReg(IR::ScalarReg(inst.dst[1].code), src0);
|
ir.SetThreadBitScalarReg(IR::ScalarReg(inst.dst[1].code), op(src0));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
Loading…
Add table
Reference in a new issue