mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-15 19:16:32 +00:00
DXIL Debugger support for Integer division and remainder instructions
Operation::UDiv Operation::SDiv Operation::URem Operation::SRem Remainder implemented using % which keeps the remainder having the same sign as the dividend
This commit is contained in:
@@ -2561,6 +2561,10 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
|
||||
case Operation::Add:
|
||||
case Operation::Sub:
|
||||
case Operation::Mul:
|
||||
case Operation::UDiv:
|
||||
case Operation::SDiv:
|
||||
case Operation::URem:
|
||||
case Operation::SRem:
|
||||
{
|
||||
RDCASSERTEQUAL(inst.args[0]->type->type, Type::TypeKind::Scalar);
|
||||
RDCASSERTEQUAL(inst.args[0]->type->scalarType, Type::Int);
|
||||
@@ -2594,6 +2598,34 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
|
||||
|
||||
IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type);
|
||||
}
|
||||
else if(opCode == Operation::UDiv)
|
||||
{
|
||||
#undef _IMPL
|
||||
#define _IMPL(I, S, U) comp<U>(result, c) = comp<U>(a, c) / comp<U>(b, c)
|
||||
|
||||
IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type);
|
||||
}
|
||||
else if(opCode == Operation::SDiv)
|
||||
{
|
||||
#undef _IMPL
|
||||
#define _IMPL(I, S, U) comp<S>(result, c) = comp<S>(a, c) / comp<S>(b, c)
|
||||
|
||||
IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type);
|
||||
}
|
||||
else if(opCode == Operation::URem)
|
||||
{
|
||||
#undef _IMPL
|
||||
#define _IMPL(I, S, U) comp<U>(result, c) = comp<U>(a, c) % comp<U>(b, c)
|
||||
|
||||
IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type);
|
||||
}
|
||||
else if(opCode == Operation::SRem)
|
||||
{
|
||||
#undef _IMPL
|
||||
#define _IMPL(I, S, U) comp<S>(result, c) = comp<S>(a, c) % comp<S>(b, c)
|
||||
|
||||
IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type);
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCERR("Unhandled opCode %s", ToStr(opCode).c_str());
|
||||
@@ -3017,10 +3049,6 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
|
||||
case Operation::PtrToI:
|
||||
case Operation::IToPtr:
|
||||
case Operation::AddrSpaceCast:
|
||||
case Operation::UDiv:
|
||||
case Operation::SDiv:
|
||||
case Operation::URem:
|
||||
case Operation::SRem:
|
||||
case Operation::ExtractElement:
|
||||
case Operation::InsertElement:
|
||||
case Operation::ShuffleVector:
|
||||
|
||||
@@ -1773,10 +1773,6 @@ rdcstr Program::GetDebugStatus()
|
||||
case Operation::PtrToI:
|
||||
case Operation::IToPtr:
|
||||
case Operation::AddrSpaceCast:
|
||||
case Operation::UDiv:
|
||||
case Operation::SDiv:
|
||||
case Operation::URem:
|
||||
case Operation::SRem:
|
||||
case Operation::ExtractElement:
|
||||
case Operation::InsertElement:
|
||||
case Operation::ShuffleVector:
|
||||
|
||||
Reference in New Issue
Block a user