shader_recompiler: Misc shader fixes. (#2781)

* shader_recompiler: Fix frexp exponent type.

* shader_recompiler: Implement V_CMP_CLASS_F32 negative class mask.

* shader_recompiler: Define operands for DS_ORDERED_COUNT.
This commit is contained in:
squidbus 2025-04-13 23:46:30 -07:00 committed by GitHub
parent 657073b9e2
commit bec1b9056f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 7 deletions

View file

@ -2784,8 +2784,7 @@ constexpr std::array<InstFormat, 256> InstructionFormatDS = {{
// 62 = DS_APPEND
{InstClass::DsAppendCon, InstCategory::DataShare, 3, 1, ScalarType::Uint32, ScalarType::Uint32},
// 63 = DS_ORDERED_COUNT
{InstClass::GdsOrdCnt, InstCategory::DataShare, 3, 1, ScalarType::Undefined,
ScalarType::Undefined},
{InstClass::GdsOrdCnt, InstCategory::DataShare, 3, 1, ScalarType::Uint32, ScalarType::Uint32},
// 64 = DS_ADD_U64
{InstClass::DsAtomicArith64, InstCategory::DataShare, 3, 1, ScalarType::Uint64,
ScalarType::Uint64},

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.