From 847bd9f49613e3cd6431640c66c233010676551b Mon Sep 17 00:00:00 2001 From: Zheorgyan Date: Thu, 8 Oct 2026 14:59:28 +0200 Subject: [PATCH] fix(shader): keep v_exp_f32 at or above the smallest normal for inputs from -126 --- core/shader/recompiler/Translation/src/FloatInstructions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/shader/recompiler/Translation/src/FloatInstructions.cpp b/core/shader/recompiler/Translation/src/FloatInstructions.cpp index 7893e151c..0c0da0895 100644 --- a/core/shader/recompiler/Translation/src/FloatInstructions.cpp +++ b/core/shader/recompiler/Translation/src/FloatInstructions.cpp @@ -101,6 +101,7 @@ std::pair TranslationContext::unaryFloatSpecials(IrOpcode opcode, I const IrU1 overflow(ir.LogicalAnd(ir.IEqual(sign.Value(), ir.Constant(0u)), ir.UGreaterThan(magnitude.Value(), ir.Constant(0x42ffffffu)))); const IrU1 underflow(ir.LogicalAnd(negative.Value(), ir.UGreaterThan(magnitude.Value(), ir.Constant(0x42fc0000u)))); value = pick(overflow, ir.Constant(0x7f800000u), value); + value = IrU32(ir.Emit(IrOpcode::UMax32, IrType::U32, {&value.Value(), &ir.Constant(0x00800000u)})); value = pick(underflow, ir.Constant(0u), value); value = pick(zero, ir.Constant(0x3f800000u), value); break;