diff --git a/src/shader_recompiler/frontend/translate/vector_alu.cpp b/src/shader_recompiler/frontend/translate/vector_alu.cpp index d57fe57bf..0d4156ee1 100644 --- a/src/shader_recompiler/frontend/translate/vector_alu.cpp +++ b/src/shader_recompiler/frontend/translate/vector_alu.cpp @@ -1160,7 +1160,8 @@ void Translator::V_CMP_U64(ConditionOp op, bool is_signed, bool set_exec, const case OperandField::SignedConstIntPos: return ir.Imm64(static_cast(inst.src[0].code)); case OperandField::SignedConstIntNeg: - return ir.Imm64(static_cast(-s32(inst.src[0].code))); + s32 decoded_value = -s32(inst.src[0].code) + SignedConstIntNegMin - 1; + return ir.Imm64(static_cast(decoded_value)); default: UNREACHABLE_MSG("src0 = {}", u32(inst.src[0].field)); } @@ -1189,7 +1190,8 @@ void Translator::V_CMP_U64(ConditionOp op, bool is_signed, bool set_exec, const case OperandField::SignedConstIntPos: return ir.Imm64(static_cast(inst.src[1].code)); case OperandField::SignedConstIntNeg: - return ir.Imm64(static_cast(-s32(inst.src[1].code))); + s32 decoded_value = -s32(inst.src[0].code) + SignedConstIntNegMin - 1; + return ir.Imm64(static_cast(decoded_value)); default: UNREACHABLE_MSG("Unsupported src[1] operand field: {}", u32(inst.src[1].field)); }