Browse Source

Revert "[common, hle/kernel] Remove LTO_NOINLINE (#2908)"

This reverts commit 2dc6d773ee.
revert-noinline
crueter 1 month ago
parent
commit
d3b0541c44
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 9
      src/common/common_funcs.h
  2. 14
      src/core/hle/kernel/kernel.cpp

9
src/common/common_funcs.h

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -34,6 +31,12 @@
#ifdef _MSC_VER #ifdef _MSC_VER
# define locale_t _locale_t // Locale Cross-Compatibility # define locale_t _locale_t // Locale Cross-Compatibility
#define LTO_NOINLINE __attribute__((noinline))
#else // _MSC_VER
#define LTO_NOINLINE
#endif // _MSC_VER #endif // _MSC_VER
#define DECLARE_ENUM_FLAG_OPERATORS(type) \ #define DECLARE_ENUM_FLAG_OPERATORS(type) \

14
src/core/hle/kernel/kernel.cpp

@ -356,7 +356,7 @@ struct KernelCore::Impl {
} }
/// Sets the host thread ID for the caller. /// Sets the host thread ID for the caller.
u32 SetHostThreadId(std::size_t core_id) {
LTO_NOINLINE u32 SetHostThreadId(std::size_t core_id) {
// This should only be called during core init. // This should only be called during core init.
ASSERT(tls_data.host_thread_id == UINT8_MAX); ASSERT(tls_data.host_thread_id == UINT8_MAX);
@ -367,12 +367,12 @@ struct KernelCore::Impl {
} }
/// Gets the host thread ID for the caller /// Gets the host thread ID for the caller
u32 GetHostThreadId() const {
LTO_NOINLINE u32 GetHostThreadId() const {
return tls_data.host_thread_id; return tls_data.host_thread_id;
} }
// Gets the dummy KThread for the caller, allocating a new one if this is the first time // Gets the dummy KThread for the caller, allocating a new one if this is the first time
KThread* GetHostDummyThread(KThread* existing_thread) {
LTO_NOINLINE KThread* GetHostDummyThread(KThread* existing_thread) {
if (tls_data.thread == nullptr) { if (tls_data.thread == nullptr) {
auto const initialize{[](KThread* thread) { auto const initialize{[](KThread* thread) {
ASSERT(KThread::InitializeDummyThread(thread, nullptr).IsSuccess()); ASSERT(KThread::InitializeDummyThread(thread, nullptr).IsSuccess());
@ -406,10 +406,10 @@ struct KernelCore::Impl {
} }
// Forces singlecore // Forces singlecore
bool IsPhantomModeForSingleCore() const {
LTO_NOINLINE bool IsPhantomModeForSingleCore() const {
return tls_data.is_phantom_mode_for_singlecore; return tls_data.is_phantom_mode_for_singlecore;
} }
void SetIsPhantomModeForSingleCore(bool value) {
LTO_NOINLINE void SetIsPhantomModeForSingleCore(bool value) {
ASSERT(!is_multicore); ASSERT(!is_multicore);
tls_data.is_phantom_mode_for_singlecore = value; tls_data.is_phantom_mode_for_singlecore = value;
} }
@ -418,13 +418,13 @@ struct KernelCore::Impl {
return is_shutting_down.load(std::memory_order_relaxed); return is_shutting_down.load(std::memory_order_relaxed);
} }
KThread* GetCurrentEmuThread() {
LTO_NOINLINE KThread* GetCurrentEmuThread() {
if (!tls_data.current_thread) if (!tls_data.current_thread)
tls_data.current_thread = GetHostDummyThread(nullptr); tls_data.current_thread = GetHostDummyThread(nullptr);
return tls_data.current_thread; return tls_data.current_thread;
} }
void SetCurrentEmuThread(KThread* thread) {
LTO_NOINLINE void SetCurrentEmuThread(KThread* thread) {
tls_data.current_thread = thread; tls_data.current_thread = thread;
} }

Loading…
Cancel
Save