shader_recompiler: Implement V_CMP_CLASS_F32 negative class mask.

This commit is contained in:
squidbus 2025-04-13 21:55:43 -07:00
parent 2d88468f14
commit 8d18f6d982
2 changed files with 4 additions and 1 deletions

View file

@ -1010,8 +1010,10 @@ void Translator::V_CMP_CLASS_F32(const GcnInst& inst) {
value = ir.FPIsNan(src0);
} else if ((class_mask & IR::FloatClassFunc::Infinity) == IR::FloatClassFunc::Infinity) {
value = ir.FPIsInf(src0);
} else if ((class_mask & IR::FloatClassFunc::Negative) == IR::FloatClassFunc::Negative) {
value = ir.FPLessThanEqual(src0, ir.Imm32(-0.f));
} else {
UNREACHABLE();
UNREACHABLE_MSG("Unsupported float class mask: {:#x}", static_cast<u32>(class_mask));
}
} else {
// We don't know the type yet, delay its resolution.

View file

@ -25,6 +25,7 @@ enum class FloatClassFunc : u32 {
NaN = SignalingNan | QuietNan,
Infinity = PositiveInfinity | NegativeInfinity,
Negative = NegativeInfinity | NegativeNormal | NegativeDenorm | NegativeZero,
Finite = NegativeNormal | NegativeDenorm | NegativeZero | PositiveNormal | PositiveDenorm |
PositiveZero,
};