summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-11-12 03:13:47 -0500
committerGravatar Lioncash2019-11-12 07:06:48 -0500
commit19a0abc19b8fca323d76946debb42f9d7f965a7d (patch)
tree35b0559015c9ab4db11871e4381939365261f87c /src
parentCMakeLists: Make most implicit type conversion warnings errors on MSVC (diff)
downloadyuzu-19a0abc19b8fca323d76946debb42f9d7f965a7d.tar.gz
yuzu-19a0abc19b8fca323d76946debb42f9d7f965a7d.tar.xz
yuzu-19a0abc19b8fca323d76946debb42f9d7f965a7d.zip
arm_unicorn: Resolve sign conversion warnings
While we're at it, this also resolves a type truncation warning as well, given the code was truncating from a 64-bit value to a 32-bit one.
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.cpp2
-rw-r--r--src/core/arm/unicorn/arm_unicorn.cpp14
-rw-r--r--src/core/arm/unicorn/arm_unicorn.h2
3 files changed, 10 insertions, 8 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp
index 700c4afff..a0705b2b8 100644
--- a/src/core/arm/dynarmic/arm_dynarmic.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic.cpp
@@ -67,7 +67,7 @@ public:
67 ARM_Interface::ThreadContext ctx; 67 ARM_Interface::ThreadContext ctx;
68 parent.SaveContext(ctx); 68 parent.SaveContext(ctx);
69 parent.inner_unicorn.LoadContext(ctx); 69 parent.inner_unicorn.LoadContext(ctx);
70 parent.inner_unicorn.ExecuteInstructions(static_cast<int>(num_instructions)); 70 parent.inner_unicorn.ExecuteInstructions(num_instructions);
71 parent.inner_unicorn.SaveContext(ctx); 71 parent.inner_unicorn.SaveContext(ctx);
72 parent.LoadContext(ctx); 72 parent.LoadContext(ctx);
73 num_interpreted_instructions += num_instructions; 73 num_interpreted_instructions += num_instructions;
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp
index d4f41bfc1..9698172db 100644
--- a/src/core/arm/unicorn/arm_unicorn.cpp
+++ b/src/core/arm/unicorn/arm_unicorn.cpp
@@ -67,10 +67,11 @@ ARM_Unicorn::ARM_Unicorn(System& system) : system{system} {
67 CHECKED(uc_reg_write(uc, UC_ARM64_REG_CPACR_EL1, &fpv)); 67 CHECKED(uc_reg_write(uc, UC_ARM64_REG_CPACR_EL1, &fpv));
68 68
69 uc_hook hook{}; 69 uc_hook hook{};
70 CHECKED(uc_hook_add(uc, &hook, UC_HOOK_INTR, (void*)InterruptHook, this, 0, -1)); 70 CHECKED(uc_hook_add(uc, &hook, UC_HOOK_INTR, (void*)InterruptHook, this, 0, UINT64_MAX));
71 CHECKED(uc_hook_add(uc, &hook, UC_HOOK_MEM_INVALID, (void*)UnmappedMemoryHook, &system, 0, -1)); 71 CHECKED(uc_hook_add(uc, &hook, UC_HOOK_MEM_INVALID, (void*)UnmappedMemoryHook, &system, 0,
72 UINT64_MAX));
72 if (GDBStub::IsServerEnabled()) { 73 if (GDBStub::IsServerEnabled()) {
73 CHECKED(uc_hook_add(uc, &hook, UC_HOOK_CODE, (void*)CodeHook, this, 0, -1)); 74 CHECKED(uc_hook_add(uc, &hook, UC_HOOK_CODE, (void*)CodeHook, this, 0, UINT64_MAX));
74 last_bkpt_hit = false; 75 last_bkpt_hit = false;
75 } 76 }
76} 77}
@@ -154,9 +155,10 @@ void ARM_Unicorn::SetTPIDR_EL0(u64 value) {
154 155
155void ARM_Unicorn::Run() { 156void ARM_Unicorn::Run() {
156 if (GDBStub::IsServerEnabled()) { 157 if (GDBStub::IsServerEnabled()) {
157 ExecuteInstructions(std::max(4000000, 0)); 158 ExecuteInstructions(std::max(4000000U, 0U));
158 } else { 159 } else {
159 ExecuteInstructions(std::max(system.CoreTiming().GetDowncount(), s64{0})); 160 ExecuteInstructions(
161 std::max(std::size_t(system.CoreTiming().GetDowncount()), std::size_t{0}));
160 } 162 }
161} 163}
162 164
@@ -166,7 +168,7 @@ void ARM_Unicorn::Step() {
166 168
167MICROPROFILE_DEFINE(ARM_Jit_Unicorn, "ARM JIT", "Unicorn", MP_RGB(255, 64, 64)); 169MICROPROFILE_DEFINE(ARM_Jit_Unicorn, "ARM JIT", "Unicorn", MP_RGB(255, 64, 64));
168 170
169void ARM_Unicorn::ExecuteInstructions(int num_instructions) { 171void ARM_Unicorn::ExecuteInstructions(std::size_t num_instructions) {
170 MICROPROFILE_SCOPE(ARM_Jit_Unicorn); 172 MICROPROFILE_SCOPE(ARM_Jit_Unicorn);
171 CHECKED(uc_emu_start(uc, GetPC(), 1ULL << 63, 0, num_instructions)); 173 CHECKED(uc_emu_start(uc, GetPC(), 1ULL << 63, 0, num_instructions));
172 system.CoreTiming().AddTicks(num_instructions); 174 system.CoreTiming().AddTicks(num_instructions);
diff --git a/src/core/arm/unicorn/arm_unicorn.h b/src/core/arm/unicorn/arm_unicorn.h
index fe2ffd70c..b39426ea0 100644
--- a/src/core/arm/unicorn/arm_unicorn.h
+++ b/src/core/arm/unicorn/arm_unicorn.h
@@ -34,7 +34,7 @@ public:
34 void LoadContext(const ThreadContext& ctx) override; 34 void LoadContext(const ThreadContext& ctx) override;
35 void PrepareReschedule() override; 35 void PrepareReschedule() override;
36 void ClearExclusiveState() override; 36 void ClearExclusiveState() override;
37 void ExecuteInstructions(int num_instructions); 37 void ExecuteInstructions(std::size_t num_instructions);
38 void Run() override; 38 void Run() override;
39 void Step() override; 39 void Step() override;
40 void ClearInstructionCache() override; 40 void ClearInstructionCache() override;