mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-25 00:58:59 +02:00
[common, hle/kernel] Remove LTO_NOINLINE (#2908)
- Dont just tell the compiler what to inline/what not to inline; the compiler will be pissed off and make bad codegen Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2908 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
402d8e833d
commit
2dc6d773ee
2 changed files with 11 additions and 13 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
// 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
|
||||||
|
|
||||||
|
|
@ -39,12 +42,8 @@
|
||||||
#define Crash() exit(1)
|
#define Crash() exit(1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LTO_NOINLINE __attribute__((noinline))
|
|
||||||
|
|
||||||
#else // _MSC_VER
|
#else // _MSC_VER
|
||||||
|
|
||||||
#define LTO_NOINLINE
|
|
||||||
|
|
||||||
// Locale Cross-Compatibility
|
// Locale Cross-Compatibility
|
||||||
#define locale_t _locale_t
|
#define locale_t _locale_t
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -359,7 +359,7 @@ struct KernelCore::Impl {
|
||||||
static inline thread_local u8 host_thread_id = UINT8_MAX;
|
static inline thread_local u8 host_thread_id = UINT8_MAX;
|
||||||
|
|
||||||
/// Sets the host thread ID for the caller.
|
/// Sets the host thread ID for the caller.
|
||||||
LTO_NOINLINE u32 SetHostThreadId(std::size_t core_id) {
|
u32 SetHostThreadId(std::size_t core_id) {
|
||||||
// This should only be called during core init.
|
// This should only be called during core init.
|
||||||
ASSERT(host_thread_id == UINT8_MAX);
|
ASSERT(host_thread_id == UINT8_MAX);
|
||||||
|
|
||||||
|
|
@ -370,17 +370,16 @@ struct KernelCore::Impl {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the host thread ID for the caller
|
/// Gets the host thread ID for the caller
|
||||||
LTO_NOINLINE u32 GetHostThreadId() const {
|
u32 GetHostThreadId() const {
|
||||||
return host_thread_id;
|
return 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
|
||||||
LTO_NOINLINE KThread* GetHostDummyThread(KThread* existing_thread) {
|
KThread* GetHostDummyThread(KThread* existing_thread) {
|
||||||
const auto initialize{[](KThread* thread) LTO_NOINLINE {
|
const auto initialize{[](KThread* thread) {
|
||||||
ASSERT(KThread::InitializeDummyThread(thread, nullptr).IsSuccess());
|
ASSERT(KThread::InitializeDummyThread(thread, nullptr).IsSuccess());
|
||||||
return thread;
|
return thread;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
thread_local KThread raw_thread{system.Kernel()};
|
thread_local KThread raw_thread{system.Kernel()};
|
||||||
thread_local KThread* thread = existing_thread ? existing_thread : initialize(&raw_thread);
|
thread_local KThread* thread = existing_thread ? existing_thread : initialize(&raw_thread);
|
||||||
return thread;
|
return thread;
|
||||||
|
|
@ -410,11 +409,11 @@ struct KernelCore::Impl {
|
||||||
|
|
||||||
static inline thread_local bool is_phantom_mode_for_singlecore{false};
|
static inline thread_local bool is_phantom_mode_for_singlecore{false};
|
||||||
|
|
||||||
LTO_NOINLINE bool IsPhantomModeForSingleCore() const {
|
bool IsPhantomModeForSingleCore() const {
|
||||||
return is_phantom_mode_for_singlecore;
|
return is_phantom_mode_for_singlecore;
|
||||||
}
|
}
|
||||||
|
|
||||||
LTO_NOINLINE void SetIsPhantomModeForSingleCore(bool value) {
|
void SetIsPhantomModeForSingleCore(bool value) {
|
||||||
ASSERT(!is_multicore);
|
ASSERT(!is_multicore);
|
||||||
is_phantom_mode_for_singlecore = value;
|
is_phantom_mode_for_singlecore = value;
|
||||||
}
|
}
|
||||||
|
|
@ -425,14 +424,14 @@ struct KernelCore::Impl {
|
||||||
|
|
||||||
static inline thread_local KThread* current_thread{nullptr};
|
static inline thread_local KThread* current_thread{nullptr};
|
||||||
|
|
||||||
LTO_NOINLINE KThread* GetCurrentEmuThread() {
|
KThread* GetCurrentEmuThread() {
|
||||||
if (!current_thread) {
|
if (!current_thread) {
|
||||||
current_thread = GetHostDummyThread(nullptr);
|
current_thread = GetHostDummyThread(nullptr);
|
||||||
}
|
}
|
||||||
return current_thread;
|
return current_thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
LTO_NOINLINE void SetCurrentEmuThread(KThread* thread) {
|
void SetCurrentEmuThread(KThread* thread) {
|
||||||
current_thread = thread;
|
current_thread = thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue