mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 18:15:14 +00:00
Replaced V_CMP_EQ_U64 code to match V_CMP_U32 to test
This commit is contained in:
parent
14d619e5ae
commit
544ff1dfc5
@ -231,7 +231,7 @@ public:
|
||||
void V_CMP_F32(ConditionOp op, bool set_exec, const GcnInst& inst);
|
||||
void V_CMP_U32(ConditionOp op, bool is_signed, bool set_exec, const GcnInst& inst);
|
||||
void V_CMP_U64(ConditionOp op, bool is_signed, bool set_exec, const GcnInst& inst);
|
||||
void V_CMP_EQ_U64(NegateMode negate, const GcnInst& inst);
|
||||
void V_CMP_EQ_U64(ConditionOp op, const GcnInst& inst);
|
||||
void V_CMP_CLASS_F32(const GcnInst& inst);
|
||||
|
||||
// VOP3a
|
||||
|
@ -328,9 +328,9 @@ void Translator::EmitVectorAlu(const GcnInst& inst) {
|
||||
|
||||
// V_CMP_{OP8}_U64
|
||||
case Opcode::V_CMP_EQ_U64:
|
||||
return V_CMP_EQ_U64(NegateMode::None, inst);
|
||||
return V_CMP_EQ_U64(ConditionOp::EQ, inst);
|
||||
case Opcode::V_CMP_NE_U64:
|
||||
return V_CMP_EQ_U64(NegateMode::Result, inst);
|
||||
return V_CMP_EQ_U64(ConditionOp::LG, inst);
|
||||
|
||||
case Opcode::V_CMP_CLASS_F32:
|
||||
return V_CMP_CLASS_F32(inst);
|
||||
@ -1037,42 +1037,25 @@ void Translator::V_CMP_U32(ConditionOp op, bool is_signed, bool set_exec, const
|
||||
// }
|
||||
// }
|
||||
|
||||
void Translator::V_CMP_EQ_U64(NegateMode negate, const GcnInst& inst) {
|
||||
const auto get_src = [&](const InstOperand& operand) {
|
||||
switch (operand.field) {
|
||||
case OperandField::VccLo:
|
||||
return ir.GetVcc();
|
||||
case OperandField::ExecLo:
|
||||
return ir.GetExec();
|
||||
case OperandField::ScalarGPR:
|
||||
return ir.GetThreadBitScalarReg(IR::ScalarReg(operand.code));
|
||||
case OperandField::ConstZero:
|
||||
return ir.Imm1(false);
|
||||
void Translator::V_CMP_EQ_U64(ConditionOp op, const GcnInst& inst) {
|
||||
const IR::U64 src0{GetSrc64(inst.src[0])};
|
||||
const IR::U64 src1{GetSrc64(inst.src[1])};
|
||||
const IR::U1 result = [&] {
|
||||
switch (op) {
|
||||
case ConditionOp::EQ:
|
||||
return ir.IEqual(src0, src1);
|
||||
case ConditionOp::LG: // NE
|
||||
return ir.INotEqual(src0, src1);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
UNREACHABLE_MSG("Unsupported V_CMP_EQ_U64 condition operation: {}", u32(op));
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
const IR::U1 src0{get_src(inst.src[0])};
|
||||
auto op = [&inst, this](auto x) {
|
||||
switch (inst.src[1].field) {
|
||||
case OperandField::ConstZero:
|
||||
return ir.LogicalNot(x);
|
||||
case OperandField::SignedConstIntNeg:
|
||||
return x;
|
||||
default:
|
||||
UNREACHABLE_MSG("unhandled V_CMP_NE_U64 source argument {}", u32(inst.src[1].field));
|
||||
}
|
||||
};
|
||||
|
||||
auto result = negate == NegateMode::Result ? ir.LogicalNot(op(src0)) : src0;
|
||||
switch (inst.dst[1].field) {
|
||||
case OperandField::VccLo:
|
||||
ir.SetVcc(result);
|
||||
break;
|
||||
return ir.SetVcc(result);
|
||||
case OperandField::ScalarGPR:
|
||||
ir.SetThreadBitScalarReg(IR::ScalarReg(inst.dst[1].code), result);
|
||||
break;
|
||||
return ir.SetThreadBitScalarReg(IR::ScalarReg(inst.dst[1].code), result);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user