From 0491cebdb34e6900841651392fee08f9e7299ae1 Mon Sep 17 00:00:00 2001 From: offtkp Date: Mon, 2 Sep 2024 04:54:05 +0300 Subject: [PATCH] Set unsigned overflow flag for S_ADD_U32 --- src/shader_recompiler/frontend/translate/scalar_alu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shader_recompiler/frontend/translate/scalar_alu.cpp b/src/shader_recompiler/frontend/translate/scalar_alu.cpp index 8e25790bc..f5ec996b5 100644 --- a/src/shader_recompiler/frontend/translate/scalar_alu.cpp +++ b/src/shader_recompiler/frontend/translate/scalar_alu.cpp @@ -511,9 +511,9 @@ void Translator::S_BREV_B32(const GcnInst& inst) { void Translator::S_ADD_U32(const GcnInst& inst) { const IR::U32 src0{GetSrc(inst.src[0])}; const IR::U32 src1{GetSrc(inst.src[1])}; - SetDst(inst.dst[0], ir.IAdd(src0, src1)); - // TODO: Carry out - ir.SetScc(ir.Imm1(false)); + const IR::U32 result = ir.IAdd(src0, src1); + SetDst(inst.dst[0], result); + ir.SetScc(ir.ILessThan(result, src0, false)); } void Translator::S_SUB_U32(const GcnInst& inst) {