mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Move rotate/cntlz/cnttz helpers to Utilities/asm.h
This commit is contained in:
parent
ee96807305
commit
ed9fb8405b
15 changed files with 242 additions and 197 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "Utilities/cond.h"
|
||||
#include "Utilities/Thread.h"
|
||||
#include "Utilities/VirtualMemory.h"
|
||||
#include "Utilities/asm.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "Emu/Cell/lv2/sys_memory.h"
|
||||
#include "Emu/RSX/GSRender.h"
|
||||
|
@ -599,7 +600,7 @@ namespace vm
|
|||
const u32 size = ::align(orig_size, min_page_size);
|
||||
|
||||
// Check alignment (it's page allocation, so passing small values there is just silly)
|
||||
if (align < min_page_size || align != (0x80000000u >> cntlz32(align, true)))
|
||||
if (align < min_page_size || align != (0x80000000u >> utils::cntlz32(align, true)))
|
||||
{
|
||||
fmt::throw_exception("Invalid alignment (size=0x%x, align=0x%x)" HERE, size, align);
|
||||
}
|
||||
|
@ -852,7 +853,7 @@ namespace vm
|
|||
const u32 size = ::align(orig_size, 0x10000);
|
||||
|
||||
// Check alignment
|
||||
if (align < 0x10000 || align != (0x80000000u >> ::cntlz32(align, true)))
|
||||
if (align < 0x10000 || align != (0x80000000u >> utils::cntlz32(align, true)))
|
||||
{
|
||||
fmt::throw_exception("Invalid alignment (size=0x%x, align=0x%x)" HERE, size, align);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue