mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-06 05:53:08 +00:00
Rejig to avoid cast that some compilers might warn on
This commit is contained in:
1 file changed
+15
-12
@@ -2234,18 +2234,21 @@ void ThreadState::StepNext(bool useDebugState, const uint32_t steps,
|
||||
for(uint8_t c = 0; c < var.columns; c++)
|
||||
{
|
||||
#undef _IMPL
|
||||
#define _IMPL(I, S, U) \
|
||||
const U bitcount = comp<U>(count, c); \
|
||||
const U mask = bitcount == sizeof(U) * 8 ? ~0ULL : (U(1) << bitcount) - U(1); \
|
||||
\
|
||||
comp<U>(var, c) >>= comp<U>(offset, c); \
|
||||
comp<U>(var, c) &= mask; \
|
||||
\
|
||||
if(opdata.op == Op::BitFieldSExtract) \
|
||||
{ \
|
||||
U topbit = (mask + U(1)) >> U(1); \
|
||||
if(comp<U>(var, c) & topbit) \
|
||||
comp<U>(var, c) |= (~0ULL ^ mask); \
|
||||
#define _IMPL(I, S, U) \
|
||||
const U bitcount = comp<U>(count, c); \
|
||||
if(bitcount < sizeof(U) * 8) \
|
||||
{ \
|
||||
const U mask = (U(1) << bitcount) - U(1); \
|
||||
\
|
||||
comp<U>(var, c) >>= comp<U>(offset, c); \
|
||||
comp<U>(var, c) &= mask; \
|
||||
\
|
||||
if(opdata.op == Op::BitFieldSExtract) \
|
||||
{ \
|
||||
U topbit = (mask + U(1)) >> U(1); \
|
||||
if(comp<U>(var, c) & topbit) \
|
||||
comp<U>(var, c) |= (~0ULL ^ mask); \
|
||||
} \
|
||||
}
|
||||
|
||||
IMPL_FOR_INT_TYPES(_IMPL);
|
||||
|
||||
Reference in new issue
Block a user