Merge pull request #1571 from Zheorgyan/fix/exp-f32-smallest-normal

fix(shader): keep v_exp_f32 at or above the smallest normal for inputs from -126
This commit is contained in:
Adrià 2026-10-10 03:11:42 +02:00 committed by GitHub
commit b9d7fd6448
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -136,6 +136,7 @@ std::pair<IrF32, IrU1> 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;