mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-04 06:55:03 -06:00
SignedConstIntNeg values are encoded relative to a base value
This commit is contained in:
parent
221629b8b5
commit
ff40a9240f
@ -1160,7 +1160,8 @@ void Translator::V_CMP_U64(ConditionOp op, bool is_signed, bool set_exec, const
|
|||||||
case OperandField::SignedConstIntPos:
|
case OperandField::SignedConstIntPos:
|
||||||
return ir.Imm64(static_cast<u64>(inst.src[0].code));
|
return ir.Imm64(static_cast<u64>(inst.src[0].code));
|
||||||
case OperandField::SignedConstIntNeg:
|
case OperandField::SignedConstIntNeg:
|
||||||
return ir.Imm64(static_cast<u64>(-s32(inst.src[0].code)));
|
s32 decoded_value = -s32(inst.src[0].code) + SignedConstIntNegMin - 1;
|
||||||
|
return ir.Imm64(static_cast<u64>(decoded_value));
|
||||||
default:
|
default:
|
||||||
UNREACHABLE_MSG("src0 = {}", u32(inst.src[0].field));
|
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:
|
case OperandField::SignedConstIntPos:
|
||||||
return ir.Imm64(static_cast<u64>(inst.src[1].code));
|
return ir.Imm64(static_cast<u64>(inst.src[1].code));
|
||||||
case OperandField::SignedConstIntNeg:
|
case OperandField::SignedConstIntNeg:
|
||||||
return ir.Imm64(static_cast<u64>(-s32(inst.src[1].code)));
|
s32 decoded_value = -s32(inst.src[0].code) + SignedConstIntNegMin - 1;
|
||||||
|
return ir.Imm64(static_cast<u64>(decoded_value));
|
||||||
default:
|
default:
|
||||||
UNREACHABLE_MSG("Unsupported src[1] operand field: {}", u32(inst.src[1].field));
|
UNREACHABLE_MSG("Unsupported src[1] operand field: {}", u32(inst.src[1].field));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user