From f9da57d87fc8baa65a22d4b234866332f0e7833f Mon Sep 17 00:00:00 2001 From: scribam Date: Thu, 11 May 2023 10:24:14 +0200 Subject: [PATCH] deps: reapply patches to vixl --- core/deps/vixl/aarch64/assembler-aarch64.cc | 2 +- core/deps/vixl/aarch64/assembler-aarch64.h | 2 +- .../vixl/aarch64/macro-assembler-aarch64.cc | 1 + core/deps/vixl/code-buffer-vixl.h | 2 +- core/deps/vixl/code-generation-scopes-vixl.h | 2 +- core/deps/vixl/platform-vixl.h | 25 +++++++++++++++++++ 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/core/deps/vixl/aarch64/assembler-aarch64.cc b/core/deps/vixl/aarch64/assembler-aarch64.cc index f7fbd5e60..add0f7adf 100644 --- a/core/deps/vixl/aarch64/assembler-aarch64.cc +++ b/core/deps/vixl/aarch64/assembler-aarch64.cc @@ -58,7 +58,7 @@ void Assembler::bind(Label* label) { void Assembler::BindToOffset(Label* label, ptrdiff_t offset) { - VIXL_ASSERT((offset >= 0) && (offset <= GetBuffer()->GetCursorOffset())); +// VIXL_ASSERT((offset >= 0) && (offset <= GetBuffer()->GetCursorOffset())); // hack to have negative offsets VIXL_ASSERT(offset % kInstructionSize == 0); label->Bind(offset); diff --git a/core/deps/vixl/aarch64/assembler-aarch64.h b/core/deps/vixl/aarch64/assembler-aarch64.h index 1cc53d5fa..b5be609ef 100644 --- a/core/deps/vixl/aarch64/assembler-aarch64.h +++ b/core/deps/vixl/aarch64/assembler-aarch64.h @@ -49,7 +49,7 @@ class Label { VIXL_ASSERT(!IsLinked()); } - bool IsBound() const { return location_ >= 0; } + bool IsBound() const { return location_ != kLocationUnbound; } bool IsLinked() const { return !links_.empty(); } ptrdiff_t GetLocation() const { return location_; } diff --git a/core/deps/vixl/aarch64/macro-assembler-aarch64.cc b/core/deps/vixl/aarch64/macro-assembler-aarch64.cc index 71ad1397f..64ec5b762 100644 --- a/core/deps/vixl/aarch64/macro-assembler-aarch64.cc +++ b/core/deps/vixl/aarch64/macro-assembler-aarch64.cc @@ -2698,6 +2698,7 @@ void MacroAssembler::PrintfNoPreserve(const char* format, } dc32(arg_pattern_list); // kPrintfArgPatternListOffset } else { +#undef printf Register tmp = temps.AcquireX(); Mov(tmp, reinterpret_cast(printf)); Blr(tmp); diff --git a/core/deps/vixl/code-buffer-vixl.h b/core/deps/vixl/code-buffer-vixl.h index cb9031fef..30c911deb 100644 --- a/core/deps/vixl/code-buffer-vixl.h +++ b/core/deps/vixl/code-buffer-vixl.h @@ -75,7 +75,7 @@ class CodeBuffer { template T GetOffsetAddress(ptrdiff_t offset) const { VIXL_STATIC_ASSERT(sizeof(T) >= sizeof(uintptr_t)); - VIXL_ASSERT((offset >= 0) && (offset <= (cursor_ - buffer_))); + //VIXL_ASSERT((offset >= 0) && (offset <= (cursor_ - buffer_))); // hack to have negative offsets return reinterpret_cast(buffer_ + offset); } diff --git a/core/deps/vixl/code-generation-scopes-vixl.h b/core/deps/vixl/code-generation-scopes-vixl.h index b7ea2d92b..5920e240f 100644 --- a/core/deps/vixl/code-generation-scopes-vixl.h +++ b/core/deps/vixl/code-generation-scopes-vixl.h @@ -89,7 +89,7 @@ class CodeBufferCheckScope { VIXL_ASSERT(!initialised_); VIXL_ASSERT(assembler != NULL); assembler_ = assembler; - if (check_policy == kReserveBufferSpace) { + if (check_policy == kReserveBufferSpace && assembler->GetBuffer()->IsManaged()) { assembler->GetBuffer()->EnsureSpaceFor(size); } #ifdef VIXL_DEBUG diff --git a/core/deps/vixl/platform-vixl.h b/core/deps/vixl/platform-vixl.h index 99f54d0c4..ca0560ee5 100644 --- a/core/deps/vixl/platform-vixl.h +++ b/core/deps/vixl/platform-vixl.h @@ -32,6 +32,31 @@ extern "C" { #include } +#define VIXL_INCLUDE_TARGET_A32 +#define VIXL_CODE_BUFFER_MALLOC +//#define VIXL_DEBUG + +#if defined(__ANDROID__) && defined(VIXL_DEBUG) +#include + +#ifdef printf +#undef printf +#endif + +#ifdef puts +#undef puts +#endif + +#define LOG_TAG "flycast" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) +#define puts LOGI +#define printf LOGI +#define putinf LOGI +#endif + namespace vixl { inline void HostBreakpoint() { raise(SIGINT); } } // namespace vixl