Encode function instructions

This commit is contained in:
baldurk committed 2021-09-21 18:04:57 +01:00
1 parent 410ee1472b
commit 29c16d17e8
7 files changed
+668 -20

No files matched your search

+20 -2
View File
@@ -236,18 +236,36 @@ void FreeAlignedBuffer(byte *buf)
uint32_t Log2Floor(uint32_t value)
{
RDCASSERT(value > 0);
if(!value)
return ~0U;
return 31 - Bits::CountLeadingZeroes(value);
}
#if ENABLED(RDOC_X64)
uint64_t Log2Floor(uint64_t value)
{
RDCASSERT(value > 0);
if(!value)
return ~0ULL;
return 63 - Bits::CountLeadingZeroes(value);
}
#endif
uint32_t Log2Ceil(uint32_t value)
{
if(!value)
return ~0U;
return 32 - Bits::CountLeadingZeroes(value - 1);
}
#if ENABLED(RDOC_X64)
uint64_t Log2Ceil(uint64_t value)
{
if(!value)
return ~0ULL;
return 64 - Bits::CountLeadingZeroes(value - 1);
}
#endif
// deliberately leak so it doesn't get destroyed before our static RenderDoc destructor needs it
static rdcstr *logfile = new rdcstr;
static FileIO::LogFileHandle *logfileHandle = NULL;