Added DXIL::AtomicBinOpCode enum and DoStringise

This commit is contained in:
Jake Turner
2024-05-02 11:48:45 +01:00
parent 68b757aab6
commit 1b351968fa
2 changed files with 34 additions and 0 deletions
@@ -348,6 +348,20 @@ enum class DXOp : uint32_t
sampleCmpBias = 255,
};
enum class AtomicBinOpCode : uint32_t
{
Add,
And,
Or,
Xor,
IMin,
IMax,
UMin,
UMax,
Exchange,
Invalid // Must be last.
};
inline Operation DecodeBinOp(const Type *type, uint64_t opcode)
{
bool isFloatOp = (type->scalarType == Type::Float);
@@ -1377,3 +1391,4 @@ rdcstr escapeStringIfNeeded(const rdcstr &name);
DECLARE_REFLECTION_ENUM(DXIL::Attribute);
DECLARE_STRINGISE_TYPE(DXIL::InstructionFlags);
DECLARE_STRINGISE_TYPE(DXIL::AtomicBinOpCode);
@@ -4565,3 +4565,22 @@ rdcstr DoStringise(const DXIL::Attribute &el)
}
END_BITFIELD_STRINGISE();
}
template <>
rdcstr DoStringise(const DXIL::AtomicBinOpCode &el)
{
BEGIN_ENUM_STRINGISE(DXIL::AtomicBinOpCode)
{
STRINGISE_ENUM_CLASS_NAMED(Add, "Add")
STRINGISE_ENUM_CLASS_NAMED(And, "And")
STRINGISE_ENUM_CLASS_NAMED(Or, "Or")
STRINGISE_ENUM_CLASS_NAMED(Xor, "Xor")
STRINGISE_ENUM_CLASS_NAMED(IMin, "IMin")
STRINGISE_ENUM_CLASS_NAMED(IMax, "IMax")
STRINGISE_ENUM_CLASS_NAMED(UMin, "UMin")
STRINGISE_ENUM_CLASS_NAMED(UMax, "UMax")
STRINGISE_ENUM_CLASS_NAMED(Exchange, "Exchange")
STRINGISE_ENUM_CLASS_NAMED(Invalid, "Invalid")
}
END_ENUM_STRINGISE();
}