mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Merge branch 'master' of https://github.com/hrydgard/ppsspp into improvedTilControls
This commit is contained in:
+13
-7
@@ -42,7 +42,8 @@ ARCH_FILES := \
|
||||
$(SRC)/Core/MIPS/x86/Asm.cpp \
|
||||
$(SRC)/Core/MIPS/x86/Jit.cpp \
|
||||
$(SRC)/Core/MIPS/x86/RegCache.cpp \
|
||||
$(SRC)/Core/MIPS/x86/RegCacheFPU.cpp
|
||||
$(SRC)/Core/MIPS/x86/RegCacheFPU.cpp \
|
||||
$(SRC)/GPU/GLES/VertexDecoderX86.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
@@ -56,12 +57,13 @@ ARCH_FILES := \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompFPU.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompLoadStore.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompVFPU.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompVFPUNEON.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmAsm.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmJit.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmRegCache.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmRegCacheFPU.cpp \
|
||||
ArmEmitterTest.cpp \
|
||||
|
||||
$(SRC)/GPU/GLES/VertexDecoderArm.cpp \
|
||||
ArmEmitterTest.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||
@@ -74,12 +76,13 @@ ARCH_FILES := \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompFPU.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompLoadStore.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompVFPU.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmCompVFPUNEON.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmAsm.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmJit.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmRegCache.cpp \
|
||||
$(SRC)/Core/MIPS/ARM/ArmRegCacheFPU.cpp \
|
||||
ArmEmitterTest.cpp \
|
||||
|
||||
$(SRC)/GPU/GLES/VertexDecoderArm.cpp \
|
||||
ArmEmitterTest.cpp
|
||||
endif
|
||||
|
||||
EXEC_AND_LIB_FILES := \
|
||||
@@ -119,11 +122,9 @@ EXEC_AND_LIB_FILES := \
|
||||
$(SRC)/Common/MsgHandler.cpp \
|
||||
$(SRC)/Common/FileUtil.cpp \
|
||||
$(SRC)/Common/StringUtils.cpp \
|
||||
$(SRC)/Common/Thread.cpp \
|
||||
$(SRC)/Common/ThreadPools.cpp \
|
||||
$(SRC)/Common/Timer.cpp \
|
||||
$(SRC)/Common/Misc.cpp \
|
||||
$(SRC)/Common/MathUtil.cpp \
|
||||
$(SRC)/GPU/Math3D.cpp \
|
||||
$(SRC)/GPU/GPUCommon.cpp \
|
||||
$(SRC)/GPU/GPUState.cpp \
|
||||
@@ -138,6 +139,7 @@ EXEC_AND_LIB_FILES := \
|
||||
$(SRC)/GPU/GLES/GLES_GPU.cpp.arm \
|
||||
$(SRC)/GPU/GLES/TextureCache.cpp.arm \
|
||||
$(SRC)/GPU/GLES/TransformPipeline.cpp.arm \
|
||||
$(SRC)/GPU/GLES/SoftwareTransform.cpp.arm \
|
||||
$(SRC)/GPU/GLES/StateMapping.cpp.arm \
|
||||
$(SRC)/GPU/GLES/VertexDecoder.cpp.arm \
|
||||
$(SRC)/GPU/GLES/ShaderManager.cpp.arm \
|
||||
@@ -225,6 +227,7 @@ EXEC_AND_LIB_FILES := \
|
||||
$(SRC)/Core/HLE/sceMp4.cpp \
|
||||
$(SRC)/Core/HLE/sceMp3.cpp \
|
||||
$(SRC)/Core/HLE/sceNet.cpp \
|
||||
$(SRC)/Core/HLE/proAdhoc.cpp \
|
||||
$(SRC)/Core/HLE/sceNetAdhoc.cpp \
|
||||
$(SRC)/Core/HLE/sceOpenPSID.cpp \
|
||||
$(SRC)/Core/HLE/sceP3da.cpp \
|
||||
@@ -251,6 +254,7 @@ EXEC_AND_LIB_FILES := \
|
||||
$(SRC)/Core/FileSystems/tlzrc.cpp \
|
||||
$(SRC)/Core/MIPS/JitCommon/JitCommon.cpp \
|
||||
$(SRC)/Core/MIPS/JitCommon/JitBlockCache.cpp \
|
||||
$(SRC)/Core/Util/GameManager.cpp \
|
||||
$(SRC)/Core/Util/BlockAllocator.cpp \
|
||||
$(SRC)/Core/Util/ppge_atlas.cpp \
|
||||
$(SRC)/Core/Util/PPGeDraw.cpp \
|
||||
@@ -265,6 +269,7 @@ LOCAL_SRC_FILES := \
|
||||
$(SRC)/UI/EmuScreen.cpp \
|
||||
$(SRC)/UI/MainScreen.cpp \
|
||||
$(SRC)/UI/MiscScreens.cpp \
|
||||
$(SRC)/UI/Store.cpp \
|
||||
$(SRC)/UI/UIShader.cpp \
|
||||
$(SRC)/UI/GamepadEmu.cpp \
|
||||
$(SRC)/UI/GameInfoCache.cpp \
|
||||
@@ -276,6 +281,7 @@ LOCAL_SRC_FILES := \
|
||||
$(SRC)/UI/TouchControlLayoutScreen.cpp \
|
||||
$(SRC)/UI/TouchControlVisibilityScreen.cpp \
|
||||
$(SRC)/UI/CwCheatScreen.cpp \
|
||||
$(SRC)/UI/InstallZipScreen.cpp \
|
||||
$(SRC)/UI/NativeApp.cpp
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -3,4 +3,4 @@ APP_STL := gnustl_static
|
||||
APP_ABI := armeabi-v7a armeabi x86
|
||||
#APP_ABI := armeabi-v7a
|
||||
APP_GNUSTL_CPP_FEATURES :=
|
||||
NDK_TOOLCHAIN_VERSION := 4.8
|
||||
NDK_TOOLCHAIN_VERSION := 4.6
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "ArmEmitterTest.h"
|
||||
|
||||
#include "Common/ArmEmitter.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
|
||||
static bool functionWasCalled;
|
||||
|
||||
@@ -22,11 +23,61 @@ TestCode::TestCode()
|
||||
|
||||
static float abc[256] = {1.0f, 2.0f, 0.0f};
|
||||
|
||||
static float a[4] = {1.0f, 2.0f, 3.0f, 4.5f};
|
||||
static float b[4] = {1.0f, 1.0f, 1.0f, 0.5f};
|
||||
static float c[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
|
||||
static u32 x[4] = {0x04030201, 0x08070605, 0x0, 0x0};
|
||||
static u32 y[4] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
|
||||
static u32 z[4] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
|
||||
|
||||
void TestCode::Generate()
|
||||
{
|
||||
testCodePtr = this->GetCodePtr();
|
||||
// Sonic1 commented that R11 is the frame pointer in debug mode, whatever "debug mode" means.
|
||||
PUSH(2, R11, _LR);
|
||||
|
||||
// Load the three pointers
|
||||
/*
|
||||
MOVP2R(R0, a);
|
||||
MOVP2R(R1, b);
|
||||
MOVP2R(R2, c);
|
||||
|
||||
// Load from two, do the operation, write to the third.
|
||||
VLD1(F_32, D0, R0, 2); // Load 2 doubles
|
||||
VLD1(F_32, D2, R1, 2); // Load another 2 doubles
|
||||
// VADD(F_32, Q2, Q0, Q1); // Add them, seeing them as floating point quads
|
||||
VMUL_scalar(F_32, Q2, Q0, DScalar(D3, 1)); // Multiply a quad by a scalar (ultra efficient for matrix mul! limitation: Scalar has to come out of D0-D15)
|
||||
ADD(R1, R1, 12);
|
||||
VLD1_all_lanes(F_32, Q2, R1, true);
|
||||
ADD(R0, R0, 12);
|
||||
VLD1_lane(F_32, D4, R0, 1, true);
|
||||
// VMUL(F_32, Q2, Q0, Q1);
|
||||
VST1(F_32, D4, R2, 2);
|
||||
*/
|
||||
|
||||
// Let's try some integer stuff
|
||||
MOVP2R(R0, x);
|
||||
MOVP2R(R1, y);
|
||||
MOVP2R(R2, z);
|
||||
MOVP2R(R3, c);
|
||||
VLD1(I_32, D0, R0, 1); // Load 1 double
|
||||
VMOVL(I_8 | I_UNSIGNED, Q1, D0);
|
||||
VMOVL(I_16 | I_UNSIGNED, Q2, D2);
|
||||
VCVT(F_32 | I_SIGNED, Q3, Q2);
|
||||
VST1(I_32, D2, R1, 2);
|
||||
VST1(I_32, D4, R2, 2);
|
||||
VST1(I_32, D6, R3, 2);
|
||||
PLD(R1, 32);
|
||||
u32 word = *(u32 *)(GetCodePtr() - 4);
|
||||
ILOG("Instruction Word: %08x", word);
|
||||
|
||||
|
||||
// This works!
|
||||
|
||||
// c will later be logged.
|
||||
|
||||
/*
|
||||
MOVI2R(R11, (u32)&abc[0]);
|
||||
MOVI2R(R1, 0x3f800000);
|
||||
STR(R11, R1, 4 * (32 + 31));
|
||||
@@ -35,9 +86,13 @@ void TestCode::Generate()
|
||||
VADD(S12, S0, S1);
|
||||
VSTR(S0, R11, 4 * (32 + 31));
|
||||
VSTR(S12, R11, 4 * (32 + 31));
|
||||
*/
|
||||
//VSTR(S2, R0, 8);
|
||||
POP(2, R11, _PC); // Yup, this is how you return.
|
||||
|
||||
FlushLitPool();
|
||||
FlushIcache();
|
||||
|
||||
//VLDR(S1, R0, 4);
|
||||
//VADD(S2, S0, S1);
|
||||
//VSTR(S2, R0, 8);
|
||||
@@ -61,13 +116,31 @@ void ArmEmitterTest()
|
||||
{
|
||||
// Disabled for now.
|
||||
return;
|
||||
|
||||
// If I commit with it enabled by accident, let's not blow up.
|
||||
if (!cpu_info.bNEON)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
ILOG("--------------------------");
|
||||
}
|
||||
ILOG("--------------------------");
|
||||
ILOG("Running ARM emitter test!");
|
||||
ILOG("--------------------------");
|
||||
|
||||
TestCode gen;
|
||||
gen.ReserveCodeSpace(0x1000);
|
||||
const u8 *codeStart = gen.GetCodePtr();
|
||||
gen.Generate();
|
||||
DisassembleArm(codeStart, gen.GetCodePtr()-codeStart);
|
||||
|
||||
u32 retval = CallPtr(gen.testCodePtr);
|
||||
ILOG("ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval);
|
||||
// ILOG("ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval);
|
||||
ILOG("x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]);
|
||||
ILOG("y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]);
|
||||
ILOG("z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]);
|
||||
ILOG("c: %f %f %f %f", c[0], c[1], c[2], c[3]);
|
||||
for (int i = 0; i < 6; i++) {
|
||||
ILOG("--------------------------");
|
||||
}
|
||||
// DisassembleArm(codeStart, gen.GetCodePtr()-codeStart);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/../../Common \
|
||||
$(LOCAL_PATH)/../.. \
|
||||
$(LOCAL_PATH)/$(NATIVE)/base \
|
||||
$(LOCAL_PATH)/$(NATIVE)/ext \
|
||||
$(LOCAL_PATH)/$(NATIVE)/ext/libzip \
|
||||
$(LOCAL_PATH)/$(NATIVE) \
|
||||
$(LOCAL_PATH)
|
||||
|
||||
Reference in New Issue
Block a user