mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-06 09:06:55 +00:00
Make the unittests build on mac
This commit is contained in:
parent
95cd1478de
commit
9f24076b63
@ -314,9 +314,14 @@ else()
|
||||
Common/FakeEmitter.h)
|
||||
endif()
|
||||
# ARMEmitter is here for the unit tests and don't really hurt otherwise.
|
||||
if(UNITTEST)
|
||||
set(CommonExtra ${CommonExtra}
|
||||
Common/Arm64Emitter.h
|
||||
Common/Arm64Emitter.cpp
|
||||
Common/ArmEmitter.h
|
||||
Common/ArmEmitter.cpp)
|
||||
Common/ArmEmitter.cpp
|
||||
Core/Util/DisArm64.cpp)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(CommonExtra ${CommonExtra}
|
||||
@ -1576,9 +1581,16 @@ endif()
|
||||
if(UNITTEST)
|
||||
add_executable(unitTest
|
||||
unittest/UnitTest.cpp
|
||||
unittest/TestArmEmitter.cpp
|
||||
unittest/TestArm64Emitter.cpp
|
||||
unittest/TestX64Emitter.cpp
|
||||
unittest/JitHarness.cpp
|
||||
Core/MIPS/ARM/ArmRegCache.cpp
|
||||
Core/MIPS/ARM/ArmRegCacheFPU.cpp
|
||||
UI/OnScreenDisplay.cpp
|
||||
)
|
||||
target_link_libraries(unitTest
|
||||
${COCOA_LIBRARY} ${LinkCommon})
|
||||
${COCOA_LIBRARY} ${LinkCommon} Common)
|
||||
setup_target_project(unitTest unittest)
|
||||
endif()
|
||||
|
||||
@ -1603,7 +1615,7 @@ if (TargetBin)
|
||||
else()
|
||||
add_executable(${TargetBin} ${NativeAppSource})
|
||||
endif()
|
||||
target_link_libraries(${TargetBin} ${LinkCommon})
|
||||
target_link_libraries(${TargetBin} ${LinkCommon} Common)
|
||||
endif()
|
||||
|
||||
# installs
|
||||
|
@ -4,8 +4,11 @@
|
||||
|
||||
#include <limits>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "Arm64Emitter.h"
|
||||
@ -301,7 +304,7 @@ void ARM64XEmitter::FlushIcacheSection(u8* start, u8* end)
|
||||
// Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
|
||||
sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
|
||||
#else
|
||||
#ifdef __clang__
|
||||
#if defined(__clang__) && !defined(_M_IX86) && !defined(_M_X64)
|
||||
__clear_cache(start, end);
|
||||
#else
|
||||
#if !defined(_M_IX86) && !defined(_M_X64)
|
||||
@ -1864,11 +1867,11 @@ void ARM64XEmitter::MOVI2R(ARM64Reg Rd, u64 imm, bool optimize)
|
||||
|
||||
u64 aligned_pc = (u64)GetCodePtr() & ~0xFFF;
|
||||
s64 aligned_offset = (s64)imm - (s64)aligned_pc;
|
||||
if (upload_part.Count() > 1 && std::abs(aligned_offset) < 0xFFFFFFFF)
|
||||
if (upload_part.Count() > 1 && aligned_offset >= -0xFFFFFFFFLL && aligned_offset <= 0xFFFFFFFFLL)
|
||||
{
|
||||
// Immediate we are loading is within 4GB of our aligned range
|
||||
// Most likely a address that we can load in one or two instructions
|
||||
if (!(std::abs(aligned_offset) & 0xFFF))
|
||||
if (aligned_offset >= -0xFFFLL && aligned_offset <= 0xFFFLL)
|
||||
{
|
||||
// Aligned ADR
|
||||
ADRP(Rd, (s32)aligned_offset);
|
||||
|
Loading…
x
Reference in New Issue
Block a user