DXIL Disassembly custom handling for DXOp::QuadOp

QuadReadAcrossX
QuadReadAcrossY
QuadReadAcrossDiagonal
This commit is contained in:
Jake Turner
2024-12-15 13:01:33 +00:00
parent 9fb4a9aa64
commit ec88bbed21
3 changed files with 48 additions and 0 deletions
@@ -618,6 +618,16 @@ enum class AtomicBinOpCode : uint32_t
Invalid // Must be last.
};
enum class QuadOpKind : uint32_t
{
ReadAcrossX = 0, // returns the value from the other lane in the quad in the
// horizontal direction
ReadAcrossY = 1, // returns the value from the other lane in the quad in the
// vertical direction
ReadAcrossDiagonal = 2, // returns the value from the lane across the quad in
// horizontal and vertical direction
};
enum class BarrierMode : uint32_t
{
Invalid = 0,
@@ -1763,6 +1773,7 @@ void SanitiseName(rdcstr &name);
DECLARE_REFLECTION_ENUM(DXIL::Attribute);
DECLARE_STRINGISE_TYPE(DXIL::InstructionFlags);
DECLARE_STRINGISE_TYPE(DXIL::AtomicBinOpCode);
DECLARE_STRINGISE_TYPE(DXIL::QuadOpKind);
DECLARE_STRINGISE_TYPE(DXIL::Operation);
DECLARE_STRINGISE_TYPE(DXIL::DXOp);
DECLARE_STRINGISE_TYPE(DXIL::Type::TypeKind);
@@ -4100,6 +4100,31 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
}
break;
}
case DXOp::QuadOp:
{
// QuadOp(value,op)
QuadOpKind quadOpKind;
if(getival<QuadOpKind>(inst.args[2], quadOpKind))
{
// QuadReadAcrossDiagonal
// QuadReadAcrossX
// QuadReadAcrossY
if(quadOpKind == QuadOpKind::ReadAcrossX)
lineStr += "QuadReadAcrossX";
else if(quadOpKind == QuadOpKind::ReadAcrossY)
lineStr += "QuadReadAcrossY";
else if(quadOpKind == QuadOpKind::ReadAcrossDiagonal)
lineStr += "QuadReadAcrossDiagonal";
lineStr += "(";
lineStr += GetArgId(inst, 1);
lineStr += ")";
}
else
{
showDxFuncName = true;
}
break;
}
case DXOp::Dot2:
case DXOp::Dot3:
case DXOp::Dot4:
@@ -127,6 +127,18 @@ rdcstr DoStringise(const DXIL::AtomicBinOpCode &el)
END_ENUM_STRINGISE();
}
template <>
rdcstr DoStringise(const DXIL::QuadOpKind &el)
{
BEGIN_ENUM_STRINGISE(DXIL::QuadOpKind)
{
STRINGISE_ENUM_CLASS(ReadAcrossX)
STRINGISE_ENUM_CLASS(ReadAcrossY)
STRINGISE_ENUM_CLASS(ReadAcrossDiagonal)
}
END_ENUM_STRINGISE();
};
template <>
rdcstr DoStringise(const DXIL::Operation &el)
{