mirror of
https://github.com/azahar-emu/dynarmic
synced 2025-11-07 07:29:59 +01:00
emit_arm64_saturation: Fix UnsignedSaturation for < 0
This commit is contained in:
parent
b059384bc0
commit
6d6cbe2e66
@ -114,8 +114,10 @@ void EmitIR<IR::Opcode::UnsignedSaturation>(oaknut::CodeGenerator& code, EmitCon
|
|||||||
const u32 saturated_value = (1u << N) - 1;
|
const u32 saturated_value = (1u << N) - 1;
|
||||||
|
|
||||||
code.MOV(Wscratch0, saturated_value);
|
code.MOV(Wscratch0, saturated_value);
|
||||||
|
code.CMP(*Woperand, 0);
|
||||||
|
code.CSEL(Wresult, Woperand, WZR, GT);
|
||||||
code.CMP(*Woperand, Wscratch0);
|
code.CMP(*Woperand, Wscratch0);
|
||||||
code.CSEL(Wresult, Woperand, Wscratch0, LS);
|
code.CSEL(Wresult, Wresult, Wscratch0, LT);
|
||||||
|
|
||||||
if (overflow_inst) {
|
if (overflow_inst) {
|
||||||
auto Woverflow = ctx.reg_alloc.WriteW(overflow_inst);
|
auto Woverflow = ctx.reg_alloc.WriteW(overflow_inst);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user