From 78fdcf75e75e007492192abe956d50ae355f456e Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 28 May 2015 18:14:22 +0300 Subject: [PATCH] Attribute macro changed __forceinline -> force_inline __noinline -> never_inline printf_alike(x,y) added --- Utilities/BEType.h | 98 +++++++++--------- Utilities/GNU.h | 96 ++++++++++-------- Utilities/Log.h | 3 +- Utilities/StrFmt.h | 24 +++-- Utilities/Thread.h | 16 +-- rpcs3/Crypto/unself.cpp | 42 ++++---- rpcs3/Emu/ARMv7/ARMv7Callback.h | 4 +- rpcs3/Emu/ARMv7/ARMv7Context.h | 38 +++---- rpcs3/Emu/ARMv7/PSVFuncList.h | 68 ++++++------- rpcs3/Emu/CPU/CPUDecoder.h | 6 +- rpcs3/Emu/CPU/CPUInstrTable.h | 2 +- rpcs3/Emu/Cell/PPCInstrTable.h | 18 ++-- rpcs3/Emu/Cell/PPUInterpreter.cpp | 2 +- rpcs3/Emu/Cell/PPUThread.h | 48 ++++----- rpcs3/Emu/Cell/RawSPUThread.h | 2 +- rpcs3/Emu/Cell/SPUThread.cpp | 2 +- rpcs3/Emu/Cell/SPUThread.h | 2 +- rpcs3/Emu/FS/vfsStream.h | 4 +- rpcs3/Emu/HDD/HDD.h | 4 +- rpcs3/Emu/Memory/atomic.h | 40 ++++---- rpcs3/Emu/Memory/vm.cpp | 4 +- rpcs3/Emu/Memory/vm.h | 12 +-- rpcs3/Emu/Memory/vm_ptr.h | 104 ++++++++++---------- rpcs3/Emu/Memory/vm_ref.h | 10 +- rpcs3/Emu/Memory/vm_var.h | 2 +- rpcs3/Emu/SysCalls/CB_FUNC.h | 28 +++--- rpcs3/Emu/SysCalls/LogBase.h | 24 ++--- rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp | 41 ++++---- rpcs3/Emu/SysCalls/Modules/cellSpurs.h | 6 +- rpcs3/Emu/SysCalls/SC_FUNC.h | 28 +++--- rpcs3/Emu/System.h | 8 +- rpcs3/stdafx.h | 2 +- 32 files changed, 395 insertions(+), 393 deletions(-) diff --git a/Utilities/BEType.h b/Utilities/BEType.h index acbefbe8c5..000f1de8dd 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -2,7 +2,7 @@ #define IS_LE_MACHINE -union _CRT_ALIGN(16) u128 +union u128 { u64 _u64[2]; s64 _s64[2]; @@ -107,12 +107,12 @@ union _CRT_ALIGN(16) u128 { } - __forceinline operator bool() const + force_inline operator bool() const { return (data & mask) != 0; } - __forceinline bit_element& operator = (const bool right) + force_inline bit_element& operator = (const bool right) { if (right) { @@ -125,7 +125,7 @@ union _CRT_ALIGN(16) u128 return *this; } - __forceinline bit_element& operator = (const bit_element& right) + force_inline bit_element& operator = (const bit_element& right) { if (right) { @@ -249,77 +249,77 @@ union _CRT_ALIGN(16) u128 return ret; } - static __forceinline u128 add8(const u128& left, const u128& right) + static force_inline u128 add8(const u128& left, const u128& right) { return fromV(_mm_add_epi8(left.vi, right.vi)); } - static __forceinline u128 add16(const u128& left, const u128& right) + static force_inline u128 add16(const u128& left, const u128& right) { return fromV(_mm_add_epi16(left.vi, right.vi)); } - static __forceinline u128 add32(const u128& left, const u128& right) + static force_inline u128 add32(const u128& left, const u128& right) { return fromV(_mm_add_epi32(left.vi, right.vi)); } - static __forceinline u128 addfs(const u128& left, const u128& right) + static force_inline u128 addfs(const u128& left, const u128& right) { return fromF(_mm_add_ps(left.vf, right.vf)); } - static __forceinline u128 addfd(const u128& left, const u128& right) + static force_inline u128 addfd(const u128& left, const u128& right) { return fromD(_mm_add_pd(left.vd, right.vd)); } - static __forceinline u128 sub8(const u128& left, const u128& right) + static force_inline u128 sub8(const u128& left, const u128& right) { return fromV(_mm_sub_epi8(left.vi, right.vi)); } - static __forceinline u128 sub16(const u128& left, const u128& right) + static force_inline u128 sub16(const u128& left, const u128& right) { return fromV(_mm_sub_epi16(left.vi, right.vi)); } - static __forceinline u128 sub32(const u128& left, const u128& right) + static force_inline u128 sub32(const u128& left, const u128& right) { return fromV(_mm_sub_epi32(left.vi, right.vi)); } - static __forceinline u128 subfs(const u128& left, const u128& right) + static force_inline u128 subfs(const u128& left, const u128& right) { return fromF(_mm_sub_ps(left.vf, right.vf)); } - static __forceinline u128 subfd(const u128& left, const u128& right) + static force_inline u128 subfd(const u128& left, const u128& right) { return fromD(_mm_sub_pd(left.vd, right.vd)); } - static __forceinline u128 maxu8(const u128& left, const u128& right) + static force_inline u128 maxu8(const u128& left, const u128& right) { return fromV(_mm_max_epu8(left.vi, right.vi)); } - static __forceinline u128 minu8(const u128& left, const u128& right) + static force_inline u128 minu8(const u128& left, const u128& right) { return fromV(_mm_min_epu8(left.vi, right.vi)); } - static __forceinline u128 eq8(const u128& left, const u128& right) + static force_inline u128 eq8(const u128& left, const u128& right) { return fromV(_mm_cmpeq_epi8(left.vi, right.vi)); } - static __forceinline u128 eq16(const u128& left, const u128& right) + static force_inline u128 eq16(const u128& left, const u128& right) { return fromV(_mm_cmpeq_epi16(left.vi, right.vi)); } - static __forceinline u128 eq32(const u128& left, const u128& right) + static force_inline u128 eq32(const u128& left, const u128& right) { return fromV(_mm_cmpeq_epi32(left.vi, right.vi)); } @@ -334,17 +334,17 @@ union _CRT_ALIGN(16) u128 return (_u64[0] != right._u64[0]) || (_u64[1] != right._u64[1]); } - __forceinline u128 operator | (const u128& right) const + force_inline u128 operator | (const u128& right) const { return fromV(_mm_or_si128(vi, right.vi)); } - __forceinline u128 operator & (const u128& right) const + force_inline u128 operator & (const u128& right) const { return fromV(_mm_and_si128(vi, right.vi)); } - __forceinline u128 operator ^ (const u128& right) const + force_inline u128 operator ^ (const u128& right) const { return fromV(_mm_xor_si128(vi, right.vi)); } @@ -354,18 +354,18 @@ union _CRT_ALIGN(16) u128 return from64(~_u64[0], ~_u64[1]); } - __forceinline bool is_any_1() const // check if any bit is 1 + force_inline bool is_any_1() const // check if any bit is 1 { return _u64[0] || _u64[1]; } - __forceinline bool is_any_0() const // check if any bit is 0 + force_inline bool is_any_0() const // check if any bit is 0 { return ~_u64[0] || ~_u64[1]; } // result = (~left) & (right) - static __forceinline u128 andnot(const u128& left, const u128& right) + static force_inline u128 andnot(const u128& left, const u128& right) { return fromV(_mm_andnot_si128(left.vi, right.vi)); } @@ -379,7 +379,7 @@ union _CRT_ALIGN(16) u128 std::string to_xyzw() const; - static __forceinline u128 byteswap(const u128 val) + static force_inline u128 byteswap(const u128 val) { u128 ret; ret._u64[0] = _byteswap_uint64(val._u64[1]); @@ -388,7 +388,9 @@ union _CRT_ALIGN(16) u128 } }; -static __forceinline u128 sync_val_compare_and_swap(volatile u128* dest, u128 comp, u128 exch) +static_assert(__alignof(u128) == 16 && sizeof(u128) == 16, "Wrong u128 size or alignment"); + +static force_inline u128 sync_val_compare_and_swap(volatile u128* dest, u128 comp, u128 exch) { #if !defined(_MSC_VER) auto res = __sync_val_compare_and_swap((volatile __int128_t*)dest, (__int128_t&)comp, (__int128_t&)exch); @@ -399,7 +401,7 @@ static __forceinline u128 sync_val_compare_and_swap(volatile u128* dest, u128 co #endif } -static __forceinline bool sync_bool_compare_and_swap(volatile u128* dest, u128 comp, u128 exch) +static force_inline bool sync_bool_compare_and_swap(volatile u128* dest, u128 comp, u128 exch) { #if !defined(_MSC_VER) return __sync_bool_compare_and_swap((volatile __int128_t*)dest, (__int128_t&)comp, (__int128_t&)exch); @@ -408,7 +410,7 @@ static __forceinline bool sync_bool_compare_and_swap(volatile u128* dest, u128 c #endif } -static __forceinline u128 sync_lock_test_and_set(volatile u128* dest, u128 value) +static force_inline u128 sync_lock_test_and_set(volatile u128* dest, u128 value) { while (true) { @@ -417,7 +419,7 @@ static __forceinline u128 sync_lock_test_and_set(volatile u128* dest, u128 value } } -static __forceinline u128 sync_fetch_and_or(volatile u128* dest, u128 value) +static force_inline u128 sync_fetch_and_or(volatile u128* dest, u128 value) { while (true) { @@ -426,7 +428,7 @@ static __forceinline u128 sync_fetch_and_or(volatile u128* dest, u128 value) } } -static __forceinline u128 sync_fetch_and_and(volatile u128* dest, u128 value) +static force_inline u128 sync_fetch_and_and(volatile u128* dest, u128 value) { while (true) { @@ -435,7 +437,7 @@ static __forceinline u128 sync_fetch_and_and(volatile u128* dest, u128 value) } } -static __forceinline u128 sync_fetch_and_xor(volatile u128* dest, u128 value) +static force_inline u128 sync_fetch_and_xor(volatile u128* dest, u128 value) { while (true) { @@ -453,12 +455,12 @@ template struct se_t; template struct se_t { - static __forceinline u8 to_be(const T& src) + static force_inline u8 to_be(const T& src) { return (u8&)src; } - static __forceinline T from_be(const u8 src) + static force_inline T from_be(const u8 src) { return (T&)src; } @@ -466,12 +468,12 @@ template struct se_t template struct se_t { - static __forceinline u16 to_be(const T& src) + static force_inline u16 to_be(const T& src) { return _byteswap_ushort((u16&)src); } - static __forceinline T from_be(const u16 src) + static force_inline T from_be(const u16 src) { const u16 res = _byteswap_ushort(src); return (T&)res; @@ -480,12 +482,12 @@ template struct se_t template struct se_t { - static __forceinline u32 to_be(const T& src) + static force_inline u32 to_be(const T& src) { return _byteswap_ulong((u32&)src); } - static __forceinline T from_be(const u32 src) + static force_inline T from_be(const u32 src) { const u32 res = _byteswap_ulong(src); return (T&)res; @@ -494,12 +496,12 @@ template struct se_t template struct se_t { - static __forceinline u64 to_be(const T& src) + static force_inline u64 to_be(const T& src) { return _byteswap_uint64((u64&)src); } - static __forceinline T from_be(const u64 src) + static force_inline T from_be(const u64 src) { const u64 res = _byteswap_uint64(src); return (T&)res; @@ -508,12 +510,12 @@ template struct se_t template struct se_t { - static __forceinline u128 to_be(const T& src) + static force_inline u128 to_be(const T& src) { return u128::byteswap((u128&)src); } - static __forceinline T from_be(const u128& src) + static force_inline T from_be(const u128& src) { const u128 res = u128::byteswap(src); return (T&)res; @@ -603,7 +605,7 @@ private: template struct _convert { - static __forceinline be_t& func(Tfrom& be_value) + static force_inline be_t& func(Tfrom& be_value) { Tto res = be_value; return (be_t&)res; @@ -613,7 +615,7 @@ private: template struct _convert { - static __forceinline be_t& func(Tfrom& be_value) + static force_inline be_t& func(Tfrom& be_value) { Tto res = se_t::func(se_t::func(be_value)); return (be_t&)res; @@ -623,7 +625,7 @@ private: template struct _convert { - static __forceinline be_t& func(Tfrom& be_value) + static force_inline be_t& func(Tfrom& be_value) { Tto res = be_value >> ((sizeof(Tfrom)-sizeof(Tto)) * 8); return (be_t&)res; @@ -673,7 +675,7 @@ public: } //get value in current machine byte ordering - __forceinline type value() const + force_inline type value() const { #ifdef IS_LE_MACHINE return ToLE(); @@ -906,13 +908,13 @@ struct convert_le_be_t> }; template -__forceinline Tto convert_le_be(Tfrom&& value) +force_inline Tto convert_le_be(Tfrom&& value) { return convert_le_be_t::func(value); } template -__forceinline void convert_le_be(Tto& dst, Tfrom&& src) +force_inline void convert_le_be(Tto& dst, Tfrom&& src) { dst = convert_le_be_t::func(src); } diff --git a/Utilities/GNU.h b/Utilities/GNU.h index 2c05012fb0..8bf07f7b53 100644 --- a/Utilities/GNU.h +++ b/Utilities/GNU.h @@ -2,22 +2,34 @@ #include -#ifdef _WIN32 +#if defined(_MSC_VER) #define thread_local __declspec(thread) #elif __APPLE__ #define thread_local __thread #endif -#ifdef _WIN32 -#define __noinline __declspec(noinline) +#if defined(_MSC_VER) +#define never_inline __declspec(noinline) #else -#define __noinline __attribute__((noinline)) +#define never_inline __attribute__((noinline)) #endif -#ifdef _WIN32 -#define __safebuffers __declspec(safebuffers) +#if defined(_MSC_VER) +#define safe_buffers __declspec(safebuffers) #else -#define __safebuffers +#define safe_buffers +#endif + +#if defined(_MSC_VER) +#define printf_alike(x, y) +#else +#define printf_alike(x, y) __attribute__((format(printf, x, y))) +#endif + +#if defined(_MSC_VER) +#define force_inline __forceinline +#else +#define force_inline __attribute__((always_inline)) #endif template @@ -46,12 +58,10 @@ void strcpy_trunc(char(&dst)[size], const char(&src)[rsize]) #endif #define _fpclass(x) std::fpclassify(x) -#define __forceinline __attribute__((always_inline)) #define _byteswap_ushort(x) __builtin_bswap16(x) #define _byteswap_ulong(x) __builtin_bswap32(x) #define _byteswap_uint64(x) __builtin_bswap64(x) #define INFINITE 0xFFFFFFFF -#define _CRT_ALIGN(x) __attribute__((aligned(x))) inline uint64_t __umulh(uint64_t a, uint64_t b) { @@ -124,181 +134,181 @@ template static inline typename std::enable_if -__noinline void log_message(Log::LogType type, Log::LogSeverity sev, const char* fmt, Targs... args) +template never_inline void log_message(Log::LogType type, Log::LogSeverity sev, const char* fmt, Args... args) printf_alike(3, 4) { log_message(type, sev, fmt::Format(fmt, fmt::do_unveil(args)...)); } diff --git a/Utilities/StrFmt.h b/Utilities/StrFmt.h index 365b60d005..b5bf570ce0 100644 --- a/Utilities/StrFmt.h +++ b/Utilities/StrFmt.h @@ -95,8 +95,7 @@ namespace fmt T by_value(T x) { return x; } //wrapper to deal with advance sprintf formating options with automatic length finding - template - std::string Format(const char* fmt, Args ... parameters) + template std::string Format(const char* fmt, Args... parameters) printf_alike(1, 2) { size_t length = 256; std::string str; @@ -139,7 +138,7 @@ namespace fmt if (src.substr(pos, comp_length) == list[i].first) { - src = (pos ? src.substr(0, pos) + list[i].second : list[i].second) + std::string(src.c_str() + pos + comp_length); + src = (pos ? src.substr(0, pos) + list[i].second : list[i].second) + src.substr(pos + comp_length); pos += list[i].second.length() - 1; break; } @@ -163,7 +162,7 @@ namespace fmt if (src.substr(pos, comp_length) == list[i].first) { - src = (pos ? src.substr(0, pos) + list[i].second() : list[i].second()) + std::string(src.c_str() + pos + comp_length); + src = (pos ? src.substr(0, pos) + list[i].second() : list[i].second()) + src.substr(pos + comp_length); pos += list[i].second().length() - 1; break; } @@ -182,7 +181,7 @@ namespace fmt { typedef T result_type; - __forceinline static result_type get_value(const T& arg) + force_inline static result_type get_value(const T& arg) { return arg; } @@ -193,7 +192,7 @@ namespace fmt { typedef const char* result_type; - __forceinline static result_type get_value(const char* arg) + force_inline static result_type get_value(const char* arg) { return arg; } @@ -204,7 +203,7 @@ namespace fmt { typedef const char* result_type; - __forceinline static result_type get_value(const char(&arg)[N]) + force_inline static result_type get_value(const char(&arg)[N]) { return arg; } @@ -215,7 +214,7 @@ namespace fmt { typedef const char* result_type; - __forceinline static result_type get_value(const std::string& arg) + force_inline static result_type get_value(const std::string& arg) { return arg.c_str(); } @@ -226,7 +225,7 @@ namespace fmt { typedef typename std::underlying_type::type result_type; - __forceinline static result_type get_value(const T& arg) + force_inline static result_type get_value(const T& arg) { return static_cast(arg); } @@ -237,14 +236,14 @@ namespace fmt { typedef typename unveil::result_type result_type; - __forceinline static result_type get_value(const be_t& arg) + force_inline static result_type get_value(const be_t& arg) { return unveil::get_value(arg.value()); } }; template - __forceinline typename unveil::result_type do_unveil(const T& arg) + force_inline typename unveil::result_type do_unveil(const T& arg) { return unveil::get_value(arg); } @@ -266,8 +265,7 @@ namespace fmt vm::psv::ref (fmt::unveil) (vm_ref.h) */ - template - __forceinline __safebuffers std::string format(const char* fmt, Args... args) + template force_inline safe_buffers std::string format(const char* fmt, Args... args) printf_alike(1, 2) { return Format(fmt, do_unveil(args)...); } diff --git a/Utilities/Thread.h b/Utilities/Thread.h index 2ce0128f1f..783f66176c 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -118,7 +118,7 @@ struct waiter_map_t bool is_stopped(u64 signal_id); // wait until waiter_func() returns true, signal_id is an arbitrary number - template __forceinline __safebuffers void wait_op(const S& signal_id, const WT waiter_func) + template force_inline safe_buffers void wait_op(const S& signal_id, const WT waiter_func) { // generate hash const auto hash = std::hash()(signal_id) % size; @@ -141,7 +141,7 @@ struct waiter_map_t } // signal all threads waiting on waiter_op() with the same signal_id (signaling only hints those threads that corresponding conditions are *probably* met) - template __forceinline void notify(const S& signal_id) + template force_inline void notify(const S& signal_id) { // generate hash const auto hash = std::hash()(signal_id) % size; @@ -258,12 +258,12 @@ public: return push(data, [do_exit](){ return do_exit && *do_exit; }); } - __forceinline bool push(const T& data) + force_inline bool push(const T& data) { return push(data, SQUEUE_NEVER_EXIT); } - __forceinline bool try_push(const T& data) + force_inline bool try_push(const T& data) { return push(data, SQUEUE_ALWAYS_EXIT); } @@ -326,12 +326,12 @@ public: return pop(data, [do_exit](){ return do_exit && *do_exit; }); } - __forceinline bool pop(T& data) + force_inline bool pop(T& data) { return pop(data, SQUEUE_NEVER_EXIT); } - __forceinline bool try_pop(T& data) + force_inline bool try_pop(T& data) { return pop(data, SQUEUE_ALWAYS_EXIT); } @@ -388,12 +388,12 @@ public: return peek(data, start_pos, [do_exit](){ return do_exit && *do_exit; }); } - __forceinline bool peek(T& data, u32 start_pos = 0) + force_inline bool peek(T& data, u32 start_pos = 0) { return peek(data, start_pos, SQUEUE_NEVER_EXIT); } - __forceinline bool try_peek(T& data, u32 start_pos = 0) + force_inline bool try_peek(T& data, u32 start_pos = 0) { return peek(data, start_pos, SQUEUE_ALWAYS_EXIT); } diff --git a/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp index 1f6645bdd0..495eac45dc 100644 --- a/rpcs3/Crypto/unself.cpp +++ b/rpcs3/Crypto/unself.cpp @@ -13,121 +13,121 @@ #include #pragma warning(pop) -__forceinline u8 Read8(vfsStream& f) +force_inline u8 Read8(vfsStream& f) { u8 ret; f.Read(&ret, sizeof(ret)); return ret; } -__forceinline u16 Read16(vfsStream& f) +force_inline u16 Read16(vfsStream& f) { be_t ret; f.Read(&ret, sizeof(ret)); return ret; } -__forceinline u32 Read32(vfsStream& f) +force_inline u32 Read32(vfsStream& f) { be_t ret; f.Read(&ret, sizeof(ret)); return ret; } -__forceinline u64 Read64(vfsStream& f) +force_inline u64 Read64(vfsStream& f) { be_t ret; f.Read(&ret, sizeof(ret)); return ret; } -__forceinline u16 Read16LE(vfsStream& f) +force_inline u16 Read16LE(vfsStream& f) { u16 ret; f.Read(&ret, sizeof(ret)); return ret; } -__forceinline u32 Read32LE(vfsStream& f) +force_inline u32 Read32LE(vfsStream& f) { u32 ret; f.Read(&ret, sizeof(ret)); return ret; } -__forceinline u64 Read64LE(vfsStream& f) +force_inline u64 Read64LE(vfsStream& f) { u64 ret; f.Read(&ret, sizeof(ret)); return ret; } -__forceinline void Write8(vfsStream& f, const u8 data) +force_inline void Write8(vfsStream& f, const u8 data) { f.Write(&data, sizeof(data)); } -__forceinline void Write8(const fs::file& f, const u8 data) +force_inline void Write8(const fs::file& f, const u8 data) { f.write(&data, sizeof(data)); } -__forceinline void Write16LE(vfsStream& f, const u16 data) +force_inline void Write16LE(vfsStream& f, const u16 data) { f.Write(&data, sizeof(data)); } -__forceinline void Write16LE(const fs::file& f, const u16 data) +force_inline void Write16LE(const fs::file& f, const u16 data) { f.write(&data, sizeof(data)); } -__forceinline void Write32LE(vfsStream& f, const u32 data) +force_inline void Write32LE(vfsStream& f, const u32 data) { f.Write(&data, sizeof(data)); } -__forceinline void Write32LE(const fs::file& f, const u32 data) +force_inline void Write32LE(const fs::file& f, const u32 data) { f.write(&data, sizeof(data)); } -__forceinline void Write64LE(vfsStream& f, const u64 data) +force_inline void Write64LE(vfsStream& f, const u64 data) { f.Write(&data, sizeof(data)); } -__forceinline void Write64LE(const fs::file& f, const u64 data) +force_inline void Write64LE(const fs::file& f, const u64 data) { f.write(&data, sizeof(data)); } -__forceinline void Write16(vfsStream& f, const u16 data) +force_inline void Write16(vfsStream& f, const u16 data) { Write16LE(f, re16(data)); } -__forceinline void Write16(const fs::file& f, const u16 data) +force_inline void Write16(const fs::file& f, const u16 data) { Write16LE(f, re16(data)); } -__forceinline void Write32(vfsStream& f, const u32 data) +force_inline void Write32(vfsStream& f, const u32 data) { Write32LE(f, re32(data)); } -__forceinline void Write32(const fs::file& f, const u32 data) +force_inline void Write32(const fs::file& f, const u32 data) { Write32LE(f, re32(data)); } -__forceinline void Write64(vfsStream& f, const u64 data) +force_inline void Write64(vfsStream& f, const u64 data) { Write64LE(f, re64(data)); } -__forceinline void Write64(const fs::file& f, const u64 data) +force_inline void Write64(const fs::file& f, const u64 data) { Write64LE(f, re64(data)); } diff --git a/rpcs3/Emu/ARMv7/ARMv7Callback.h b/rpcs3/Emu/ARMv7/ARMv7Callback.h index 18c39fe49d..0777ed4f20 100644 --- a/rpcs3/Emu/ARMv7/ARMv7Callback.h +++ b/rpcs3/Emu/ARMv7/ARMv7Callback.h @@ -5,14 +5,14 @@ namespace vm { template - __forceinline RT _ptr_base::operator()(ARMv7Context& context, T... args) const + force_inline RT _ptr_base::operator()(ARMv7Context& context, T... args) const { return psv_func_detail::func_caller::call(context, vm::cast(this->addr()), args...); } } template -__forceinline RT cb_call(ARMv7Context& context, u32 addr, T... args) +force_inline RT cb_call(ARMv7Context& context, u32 addr, T... args) { return psv_func_detail::func_caller::call(context, addr, args...); } diff --git a/rpcs3/Emu/ARMv7/ARMv7Context.h b/rpcs3/Emu/ARMv7/ARMv7Context.h index ba97ed2375..dc14117845 100644 --- a/rpcs3/Emu/ARMv7/ARMv7Context.h +++ b/rpcs3/Emu/ARMv7/ARMv7Context.h @@ -176,7 +176,7 @@ struct ARMv7Context } template - __noinline void fmt_debug_str(const char* fmt, T... args) + never_inline void fmt_debug_str(const char* fmt, T... args) { debug_str = fmt::format(fmt, args...); } @@ -189,12 +189,12 @@ struct cast_armv7_gpr typedef typename std::underlying_type::type underlying_type; - __forceinline static u32 to_gpr(const T& value) + force_inline static u32 to_gpr(const T& value) { return cast_armv7_gpr::to_gpr(static_cast(value)); } - __forceinline static T from_gpr(const u32 reg) + force_inline static T from_gpr(const u32 reg) { return static_cast(cast_armv7_gpr::from_gpr(reg)); } @@ -203,12 +203,12 @@ struct cast_armv7_gpr template<> struct cast_armv7_gpr { - __forceinline static u32 to_gpr(const u8& value) + force_inline static u32 to_gpr(const u8& value) { return value; } - __forceinline static u8 from_gpr(const u32 reg) + force_inline static u8 from_gpr(const u32 reg) { return static_cast(reg); } @@ -217,12 +217,12 @@ struct cast_armv7_gpr template<> struct cast_armv7_gpr { - __forceinline static u32 to_gpr(const u16& value) + force_inline static u32 to_gpr(const u16& value) { return value; } - __forceinline static u16 from_gpr(const u32 reg) + force_inline static u16 from_gpr(const u32 reg) { return static_cast(reg); } @@ -231,12 +231,12 @@ struct cast_armv7_gpr template<> struct cast_armv7_gpr { - __forceinline static u32 to_gpr(const u32& value) + force_inline static u32 to_gpr(const u32& value) { return value; } - __forceinline static u32 from_gpr(const u32 reg) + force_inline static u32 from_gpr(const u32 reg) { return reg; } @@ -245,12 +245,12 @@ struct cast_armv7_gpr template<> struct cast_armv7_gpr { - __forceinline static u32 to_gpr(const s8& value) + force_inline static u32 to_gpr(const s8& value) { return value; } - __forceinline static s8 from_gpr(const u32 reg) + force_inline static s8 from_gpr(const u32 reg) { return static_cast(reg); } @@ -259,12 +259,12 @@ struct cast_armv7_gpr template<> struct cast_armv7_gpr { - __forceinline static u32 to_gpr(const s16& value) + force_inline static u32 to_gpr(const s16& value) { return value; } - __forceinline static s16 from_gpr(const u32 reg) + force_inline static s16 from_gpr(const u32 reg) { return static_cast(reg); } @@ -273,12 +273,12 @@ struct cast_armv7_gpr template<> struct cast_armv7_gpr { - __forceinline static u32 to_gpr(const s32& value) + force_inline static u32 to_gpr(const s32& value) { return value; } - __forceinline static s32 from_gpr(const u32 reg) + force_inline static s32 from_gpr(const u32 reg) { return static_cast(reg); } @@ -287,25 +287,25 @@ struct cast_armv7_gpr template<> struct cast_armv7_gpr { - __forceinline static u32 to_gpr(const bool& value) + force_inline static u32 to_gpr(const bool& value) { return value; } - __forceinline static bool from_gpr(const u32& reg) + force_inline static bool from_gpr(const u32& reg) { return reinterpret_cast(reg); } }; template -__forceinline u32 cast_to_armv7_gpr(const T& value) +force_inline u32 cast_to_armv7_gpr(const T& value) { return cast_armv7_gpr::to_gpr(value); } template -__forceinline T cast_from_armv7_gpr(const u32 reg) +force_inline T cast_from_armv7_gpr(const u32 reg) { return cast_armv7_gpr::from_gpr(reg); } diff --git a/rpcs3/Emu/ARMv7/PSVFuncList.h b/rpcs3/Emu/ARMv7/PSVFuncList.h index 170b6690e5..fb7215a61a 100644 --- a/rpcs3/Emu/ARMv7/PSVFuncList.h +++ b/rpcs3/Emu/ARMv7/PSVFuncList.h @@ -56,12 +56,12 @@ namespace psv_func_detail { static_assert(sizeof(T) <= 4, "Invalid function argument type for ARG_GENERAL"); - __forceinline static T get_arg(ARMv7Context& context) + force_inline static T get_arg(ARMv7Context& context) { return cast_from_armv7_gpr(context.GPR[g_count - 1]); } - __forceinline static void put_arg(ARMv7Context& context, const T& arg) + force_inline static void put_arg(ARMv7Context& context, const T& arg) { context.GPR[g_count - 1] = cast_to_armv7_gpr(arg); } @@ -73,12 +73,12 @@ namespace psv_func_detail // first u64 argument is passed in r0-r1, second one is passed in r2-r3 (if g_count = 3) static_assert(g_count == 1 || g_count == 3, "Wrong u64 argument position"); - __forceinline static u64 get_arg(ARMv7Context& context) + force_inline static u64 get_arg(ARMv7Context& context) { return context.GPR_D[g_count >> 1]; } - __forceinline static void put_arg(ARMv7Context& context, u64 arg) + force_inline static void put_arg(ARMv7Context& context, u64 arg) { context.GPR_D[g_count >> 1] = arg; } @@ -89,12 +89,12 @@ namespace psv_func_detail { static_assert(g_count == 1 || g_count == 3, "Wrong s64 argument position"); - __forceinline static s64 get_arg(ARMv7Context& context) + force_inline static s64 get_arg(ARMv7Context& context) { return context.GPR_D[g_count >> 1]; } - __forceinline static void put_arg(ARMv7Context& context, s64 arg) + force_inline static void put_arg(ARMv7Context& context, s64 arg) { context.GPR_D[g_count >> 1] = arg; } @@ -106,11 +106,11 @@ namespace psv_func_detail static_assert(f_count <= 0, "TODO: Unsupported argument type (float)"); static_assert(sizeof(T) <= 8, "Invalid function argument type for ARG_FLOAT"); - __forceinline static T get_arg(ARMv7Context& context) + force_inline static T get_arg(ARMv7Context& context) { } - __forceinline static void put_arg(ARMv7Context& context, const T& arg) + force_inline static void put_arg(ARMv7Context& context, const T& arg) { } }; @@ -121,11 +121,11 @@ namespace psv_func_detail static_assert(v_count <= 0, "TODO: Unsupported argument type (vector)"); static_assert(std::is_same::value, "Invalid function argument type for ARG_VECTOR"); - __forceinline static T get_arg(ARMv7Context& context) + force_inline static T get_arg(ARMv7Context& context) { } - __forceinline static void put_arg(ARMv7Context& context, const T& arg) + force_inline static void put_arg(ARMv7Context& context, const T& arg) { } }; @@ -137,13 +137,13 @@ namespace psv_func_detail static_assert(v_count <= 0, "TODO: Unsupported stack argument type (vector)"); static_assert(sizeof(T) <= 4, "Invalid function argument type for ARG_STACK"); - __forceinline static T get_arg(ARMv7Context& context) + force_inline static T get_arg(ARMv7Context& context) { // TODO: check return cast_from_armv7_gpr(vm::psv::read32(context.SP + sizeof(u32) * (g_count - 5))); } - __forceinline static void put_arg(ARMv7Context& context, const T& arg) + force_inline static void put_arg(ARMv7Context& context, const T& arg) { // TODO: check const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE; @@ -156,13 +156,13 @@ namespace psv_func_detail template struct bind_arg { - __forceinline static u64 get_arg(ARMv7Context& context) + force_inline static u64 get_arg(ARMv7Context& context) { // TODO: check return vm::psv::read64(context.SP + sizeof(u32) * (g_count - 5)); } - __forceinline static void put_arg(ARMv7Context& context, u64 arg) + force_inline static void put_arg(ARMv7Context& context, u64 arg) { // TODO: check const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE; @@ -175,13 +175,13 @@ namespace psv_func_detail template struct bind_arg { - __forceinline static s64 get_arg(ARMv7Context& context) + force_inline static s64 get_arg(ARMv7Context& context) { // TODO: check return vm::psv::read64(context.SP + sizeof(u32) * (g_count - 5)); } - __forceinline static void put_arg(ARMv7Context& context, s64 arg) + force_inline static void put_arg(ARMv7Context& context, s64 arg) { // TODO: check const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE; @@ -199,12 +199,12 @@ namespace psv_func_detail static_assert(type == ARG_GENERAL, "Wrong use of bind_result template"); static_assert(sizeof(T) <= 4, "Invalid function result type for ARG_GENERAL"); - __forceinline static T get_result(ARMv7Context& context) + force_inline static T get_result(ARMv7Context& context) { return cast_from_armv7_gpr(context.GPR[0]); } - __forceinline static void put_result(ARMv7Context& context, const T& result) + force_inline static void put_result(ARMv7Context& context, const T& result) { context.GPR[0] = cast_to_armv7_gpr(result); } @@ -213,12 +213,12 @@ namespace psv_func_detail template<> struct bind_result { - __forceinline static u64 get_result(ARMv7Context& context) + force_inline static u64 get_result(ARMv7Context& context) { return context.GPR_D[0]; } - __forceinline static void put_result(ARMv7Context& context, u64 result) + force_inline static void put_result(ARMv7Context& context, u64 result) { context.GPR_D[0] = result; } @@ -227,12 +227,12 @@ namespace psv_func_detail template<> struct bind_result { - __forceinline static s64 get_result(ARMv7Context& context) + force_inline static s64 get_result(ARMv7Context& context) { return context.GPR_D[0]; } - __forceinline static void put_result(ARMv7Context& context, s64 result) + force_inline static void put_result(ARMv7Context& context, s64 result) { context.GPR_D[0] = result; } @@ -243,7 +243,7 @@ namespace psv_func_detail //{ // static_assert(sizeof(T) <= 8, "Invalid function result type for ARG_FLOAT"); - // static __forceinline void put_result(ARMv7Context& context, const T& result) + // static force_inline void put_result(ARMv7Context& context, const T& result) // { // } //}; @@ -253,7 +253,7 @@ namespace psv_func_detail //{ // static_assert(std::is_same::value, "Invalid function result type for ARG_VECTOR"); - // static __forceinline void put_result(ARMv7Context& context, const T& result) + // static force_inline void put_result(ARMv7Context& context, const T& result) // { // } //}; @@ -289,7 +289,7 @@ namespace psv_func_detail template struct call_impl { - static __forceinline RT call(F f, Tuple && t) + static force_inline RT call(F f, Tuple && t) { return call_impl::call(f, std::forward(t)); } @@ -298,28 +298,28 @@ namespace psv_func_detail template struct call_impl { - static __forceinline RT call(F f, Tuple && t) + static force_inline RT call(F f, Tuple && t) { return f(std::get(std::forward(t))...); } }; template - __forceinline RT call(F f, Tuple && t) + force_inline RT call(F f, Tuple && t) { typedef typename std::decay::type ttype; return psv_func_detail::call_impl::value, std::tuple_size::value>::call(f, std::forward(t)); } template - __forceinline std::tuple<> get_func_args(ARMv7Context& context) + force_inline std::tuple<> get_func_args(ARMv7Context& context) { // terminator return std::tuple<>(); } template - __forceinline std::tuple get_func_args(ARMv7Context& context) + force_inline std::tuple get_func_args(ARMv7Context& context) { typedef arg_type type; const arg_class t = type::value; @@ -332,14 +332,14 @@ namespace psv_func_detail } template - __forceinline static bool put_func_args(ARMv7Context& context) + force_inline static bool put_func_args(ARMv7Context& context) { // terminator return false; } template - __forceinline static bool put_func_args(ARMv7Context& context, T1 arg, T... args) + force_inline static bool put_func_args(ARMv7Context& context, T1 arg, T... args) { typedef arg_type type; const arg_class t = type::value; @@ -404,7 +404,7 @@ namespace psv_func_detail template struct func_caller { - __forceinline static RT call(ARMv7Context& context, u32 addr, T... args) + force_inline static RT call(ARMv7Context& context, u32 addr, T... args) { func_caller::call(context, addr, args...); @@ -415,7 +415,7 @@ namespace psv_func_detail template struct func_caller { - __forceinline static void call(ARMv7Context& context, u32 addr, T... args) + force_inline static void call(ARMv7Context& context, u32 addr, T... args) { if (put_func_args<0, 0, 0, T...>(context, args...)) { @@ -464,7 +464,7 @@ enum psv_special_function_index : u16 // Do not call directly u32 add_psv_func(psv_func data); // Do not call directly -template __forceinline void call_psv_func(ARMv7Context& context, RT(*func)(T...)) +template force_inline void call_psv_func(ARMv7Context& context, RT(*func)(T...)) { psv_func_detail::func_binder::do_call(context, func); } diff --git a/rpcs3/Emu/CPU/CPUDecoder.h b/rpcs3/Emu/CPU/CPUDecoder.h index 68f21cf542..5ff68f0e70 100644 --- a/rpcs3/Emu/CPU/CPUDecoder.h +++ b/rpcs3/Emu/CPU/CPUDecoder.h @@ -354,17 +354,17 @@ public: } } - __forceinline const std::string& GetName() const + force_inline const std::string& GetName() const { return m_name; } - __forceinline const uint GetArgCount() const + force_inline const uint GetArgCount() const { return m_args_count; } - __forceinline const CodeFieldBase& GetArg(uint index) const + force_inline const CodeFieldBase& GetArg(uint index) const { assert(index < m_args_count); return *m_args[index]; diff --git a/rpcs3/Emu/CPU/CPUInstrTable.h b/rpcs3/Emu/CPU/CPUInstrTable.h index 1ec101a875..1402a94cf5 100644 --- a/rpcs3/Emu/CPU/CPUInstrTable.h +++ b/rpcs3/Emu/CPU/CPUInstrTable.h @@ -1,6 +1,6 @@ #pragma once -template __forceinline static T sign(const T value) +template force_inline static T sign(const T value) { static_assert(size > 0 && size < sizeof(T) * 8, "Bad sign size"); diff --git a/rpcs3/Emu/Cell/PPCInstrTable.h b/rpcs3/Emu/Cell/PPCInstrTable.h index fead638bdb..2eac8f73a7 100644 --- a/rpcs3/Emu/Cell/PPCInstrTable.h +++ b/rpcs3/Emu/Cell/PPCInstrTable.h @@ -26,13 +26,13 @@ public: static const u32 shift = 31 - to; static const u32 mask = ((1ULL << ((to - from) + 1)) - 1) << shift; - static __forceinline void encode(u32& data, u32 value) + static force_inline void encode(u32& data, u32 value) { data &= ~mask; data |= (value << shift) & mask; } - static __forceinline u32 decode(u32 data) + static force_inline u32 decode(u32 data) { return (data & mask) >> shift; } @@ -64,13 +64,13 @@ public: static const u32 shift2 = 31 - to2; static const u32 mask2 = ((1 << ((to2 - from2) + 1)) - 1) << shift2; - static __forceinline void encode(u32& data, u32 value) + static force_inline void encode(u32& data, u32 value) { data &= ~(CodeField::mask | mask2); data |= ((value << CodeField::shift) & CodeField::mask) | (((value >> offset) << shift2) & mask2); } - static __forceinline u32 decode(u32 data) + static force_inline u32 decode(u32 data) { return ((data & CodeField::mask) >> CodeField::shift) | (((data & mask2) >> shift2) << offset); } @@ -96,7 +96,7 @@ public: static const int size = _size; - static __forceinline u32 decode(u32 data) + static force_inline u32 decode(u32 data) { return sign((data & CodeField::mask) >> CodeField::shift); } @@ -117,12 +117,12 @@ public: { } - static __forceinline u32 decode(u32 data) + static force_inline u32 decode(u32 data) { return ((data & CodeField::mask) >> CodeField::shift) << offset; } - static __forceinline void encode(u32& data, u32 value) + static force_inline void encode(u32& data, u32 value) { data &= ~CodeField::mask; data |= ((value >> offset) << CodeField::shift) & CodeField::mask; @@ -149,12 +149,12 @@ public: { } - static __forceinline u32 decode(u32 data) + static force_inline u32 decode(u32 data) { return sign((data & CodeField::mask) >> CodeField::shift) << offset; } - static __forceinline void encode(u32& data, u32 value) + static force_inline void encode(u32& data, u32 value) { data &= ~CodeField::mask; data |= ((value >> offset) << CodeField::shift) & CodeField::mask; diff --git a/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp index e012641c37..74152cfe60 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -24,7 +24,7 @@ public: } } - __forceinline __m128 operator [] (s32 scale) const + force_inline __m128 operator [] (s32 scale) const { return m_data[scale + 31]; } diff --git a/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h index 53f3a2c412..31d44fad14 100644 --- a/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -847,12 +847,12 @@ struct cast_ppu_gpr typedef typename std::underlying_type::type underlying_type; - __forceinline static u64 to_gpr(const T& value) + force_inline static u64 to_gpr(const T& value) { return cast_ppu_gpr::to_gpr(static_cast(value)); } - __forceinline static T from_gpr(const u64 reg) + force_inline static T from_gpr(const u64 reg) { return static_cast(cast_ppu_gpr::from_gpr(reg)); } @@ -861,12 +861,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const u8& value) + force_inline static u64 to_gpr(const u8& value) { return value; } - __forceinline static u8 from_gpr(const u64 reg) + force_inline static u8 from_gpr(const u64 reg) { return static_cast(reg); } @@ -875,12 +875,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const u16& value) + force_inline static u64 to_gpr(const u16& value) { return value; } - __forceinline static u16 from_gpr(const u64 reg) + force_inline static u16 from_gpr(const u64 reg) { return static_cast(reg); } @@ -889,12 +889,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const u32& value) + force_inline static u64 to_gpr(const u32& value) { return value; } - __forceinline static u32 from_gpr(const u64 reg) + force_inline static u32 from_gpr(const u64 reg) { return static_cast(reg); } @@ -904,12 +904,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const unsigned long& value) + force_inline static u64 to_gpr(const unsigned long& value) { return value; } - __forceinline static unsigned long from_gpr(const u64 reg) + force_inline static unsigned long from_gpr(const u64 reg) { return static_cast(reg); } @@ -919,12 +919,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const u64& value) + force_inline static u64 to_gpr(const u64& value) { return value; } - __forceinline static u64 from_gpr(const u64 reg) + force_inline static u64 from_gpr(const u64 reg) { return reg; } @@ -933,12 +933,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const s8& value) + force_inline static u64 to_gpr(const s8& value) { return value; } - __forceinline static s8 from_gpr(const u64 reg) + force_inline static s8 from_gpr(const u64 reg) { return static_cast(reg); } @@ -947,12 +947,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const s16& value) + force_inline static u64 to_gpr(const s16& value) { return value; } - __forceinline static s16 from_gpr(const u64 reg) + force_inline static s16 from_gpr(const u64 reg) { return static_cast(reg); } @@ -961,12 +961,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const s32& value) + force_inline static u64 to_gpr(const s32& value) { return value; } - __forceinline static s32 from_gpr(const u64 reg) + force_inline static s32 from_gpr(const u64 reg) { return static_cast(reg); } @@ -975,12 +975,12 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const s64& value) + force_inline static u64 to_gpr(const s64& value) { return value; } - __forceinline static s64 from_gpr(const u64 reg) + force_inline static s64 from_gpr(const u64 reg) { return static_cast(reg); } @@ -989,25 +989,25 @@ struct cast_ppu_gpr template<> struct cast_ppu_gpr { - __forceinline static u64 to_gpr(const bool& value) + force_inline static u64 to_gpr(const bool& value) { return value; } - __forceinline static bool from_gpr(const u64& reg) + force_inline static bool from_gpr(const u64& reg) { return reinterpret_cast(reg); } }; template -__forceinline u64 cast_to_ppu_gpr(const T& value) +force_inline u64 cast_to_ppu_gpr(const T& value) { return cast_ppu_gpr::to_gpr(value); } template -__forceinline T cast_from_ppu_gpr(const u64 reg) +force_inline T cast_from_ppu_gpr(const u64 reg) { return cast_ppu_gpr::from_gpr(reg); } diff --git a/rpcs3/Emu/Cell/RawSPUThread.h b/rpcs3/Emu/Cell/RawSPUThread.h index 51811d4f22..f4186ae4ed 100644 --- a/rpcs3/Emu/Cell/RawSPUThread.h +++ b/rpcs3/Emu/Cell/RawSPUThread.h @@ -9,7 +9,7 @@ enum : u32 RAW_SPU_PROB_OFFSET = 0x00040000, }; -__forceinline static u32 GetRawSPURegAddrByNum(int num, int offset) +force_inline static u32 GetRawSPURegAddrByNum(int num, int offset) { return RAW_SPU_OFFSET * num + RAW_SPU_BASE_ADDR + RAW_SPU_PROB_OFFSET + offset; } diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index e98c742387..29f209c3f4 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -50,7 +50,7 @@ public: } } - __forceinline spu_inter_func_t operator [] (u32 opcode) const + force_inline spu_inter_func_t operator [] (u32 opcode) const { return funcs[opcode >> 21]; } diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index 9d5e5623d1..b76fda8e1c 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -338,7 +338,7 @@ struct g_spu_imm_table_t } } - __forceinline __m128 operator [] (s32 scale) const + force_inline __m128 operator [] (s32 scale) const { return m_data[scale + 155]; } diff --git a/rpcs3/Emu/FS/vfsStream.h b/rpcs3/Emu/FS/vfsStream.h index 28e775c2cd..8fa63d0967 100644 --- a/rpcs3/Emu/FS/vfsStream.h +++ b/rpcs3/Emu/FS/vfsStream.h @@ -19,14 +19,14 @@ struct vfsStream virtual u64 Write(const void* src, u64 count) = 0; - template __forceinline bool SWrite(const T& data, u64 count = sizeof(T)) + template force_inline bool SWrite(const T& data, u64 count = sizeof(T)) { return Write(&data, count) == count; } virtual u64 Read(void* dst, u64 count) = 0; - template __forceinline bool SRead(T& data, u64 count = sizeof(T)) + template force_inline bool SRead(T& data, u64 count = sizeof(T)) { return Read(&data, count) == count; } diff --git a/rpcs3/Emu/HDD/HDD.h b/rpcs3/Emu/HDD/HDD.h index 22668d9474..4274bd66d4 100644 --- a/rpcs3/Emu/HDD/HDD.h +++ b/rpcs3/Emu/HDD/HDD.h @@ -82,7 +82,7 @@ class vfsHDDFile void WriteEntry(u64 block, const vfsHDD_Entry& data, const std::string& name); - __forceinline u32 GetMaxNameLen() const + force_inline u32 GetMaxNameLen() const { return m_hdd_info.block_size - sizeof(vfsHDD_Entry); } @@ -149,7 +149,7 @@ class vfsHDD : public vfsFileBase public: vfsHDD(vfsDevice* device, const std::string& hdd_path); - __forceinline u32 GetMaxNameLen() const + force_inline u32 GetMaxNameLen() const { return m_hdd_info.block_size - sizeof(vfsHDD_Entry); } diff --git a/rpcs3/Emu/Memory/atomic.h b/rpcs3/Emu/Memory/atomic.h index 2267f2d637..b09cf04359 100644 --- a/rpcs3/Emu/Memory/atomic.h +++ b/rpcs3/Emu/Memory/atomic.h @@ -45,62 +45,62 @@ union _atomic_base type data; // unsafe direct access subtype sub_data; // unsafe direct access to substitute type - __forceinline static const subtype to_subtype(const type& value) + force_inline static const subtype to_subtype(const type& value) { return reinterpret_cast(value); } - __forceinline static const type from_subtype(const subtype value) + force_inline static const type from_subtype(const subtype value) { return reinterpret_cast(value); } - __forceinline static type& to_type(subtype& value) + force_inline static type& to_type(subtype& value) { return reinterpret_cast(value); } public: // atomically compare data with cmp, replace with exch if equal, return previous data value anyway - __forceinline const type compare_and_swap(const type& cmp, const type& exch) volatile + force_inline const type compare_and_swap(const type& cmp, const type& exch) volatile { return from_subtype(sync_val_compare_and_swap(&sub_data, to_subtype(cmp), to_subtype(exch))); } // atomically compare data with cmp, replace with exch if equal, return true if data was replaced - __forceinline bool compare_and_swap_test(const type& cmp, const type& exch) volatile + force_inline bool compare_and_swap_test(const type& cmp, const type& exch) volatile { return sync_bool_compare_and_swap(&sub_data, to_subtype(cmp), to_subtype(exch)); } // read data with memory barrier - __forceinline const type read_sync() const volatile + force_inline const type read_sync() const volatile { const subtype zero = {}; return from_subtype(sync_val_compare_and_swap(const_cast(&sub_data), zero, zero)); } // atomically replace data with exch, return previous data value - __forceinline const type exchange(const type& exch) volatile + force_inline const type exchange(const type& exch) volatile { return from_subtype(sync_lock_test_and_set(&sub_data, to_subtype(exch))); } // read data without memory barrier - __forceinline const type read_relaxed() const volatile + force_inline const type read_relaxed() const volatile { const subtype value = const_cast(sub_data); return from_subtype(value); } // write data without memory barrier - __forceinline void write_relaxed(const type& value) volatile + force_inline void write_relaxed(const type& value) volatile { const_cast(sub_data) = to_subtype(value); } // perform atomic operation on data - template __forceinline void atomic_op(const FT atomic_proc) volatile + template force_inline void atomic_op(const FT atomic_proc) volatile { while (true) { @@ -112,7 +112,7 @@ public: } // perform atomic operation on data with special exit condition (if intermediate result != proceed_value) - template __forceinline RT atomic_op(const RT proceed_value, const FT atomic_proc) volatile + template force_inline RT atomic_op(const RT proceed_value, const FT atomic_proc) volatile { while (true) { @@ -125,7 +125,7 @@ public: } // perform atomic operation on data with additional memory barrier - template __forceinline void atomic_op_sync(const FT atomic_proc) volatile + template force_inline void atomic_op_sync(const FT atomic_proc) volatile { const subtype zero = {}; subtype old = sync_val_compare_and_swap(&sub_data, zero, zero); @@ -140,7 +140,7 @@ public: } // perform atomic operation on data with additional memory barrier and special exit condition (if intermediate result != proceed_value) - template __forceinline RT atomic_op_sync(const RT proceed_value, const FT atomic_proc) volatile + template force_inline RT atomic_op_sync(const RT proceed_value, const FT atomic_proc) volatile { const subtype zero = {}; subtype old = sync_val_compare_and_swap(&sub_data, zero, zero); @@ -156,40 +156,40 @@ public: } // atomic bitwise OR, returns previous data - __forceinline const type _or(const type& right) volatile + force_inline const type _or(const type& right) volatile { return from_subtype(sync_fetch_and_or(&sub_data, to_subtype(right))); } // atomic bitwise AND, returns previous data - __forceinline const type _and(const type& right) volatile + force_inline const type _and(const type& right) volatile { return from_subtype(sync_fetch_and_and(&sub_data, to_subtype(right))); } // atomic bitwise AND NOT (inverts right argument), returns previous data - __forceinline const type _and_not(const type& right) volatile + force_inline const type _and_not(const type& right) volatile { return from_subtype(sync_fetch_and_and(&sub_data, ~to_subtype(right))); } // atomic bitwise XOR, returns previous data - __forceinline const type _xor(const type& right) volatile + force_inline const type _xor(const type& right) volatile { return from_subtype(sync_fetch_and_xor(&sub_data, to_subtype(right))); } - __forceinline const type operator |= (const type& right) volatile + force_inline const type operator |= (const type& right) volatile { return from_subtype(sync_fetch_and_or(&sub_data, to_subtype(right)) | to_subtype(right)); } - __forceinline const type operator &= (const type& right) volatile + force_inline const type operator &= (const type& right) volatile { return from_subtype(sync_fetch_and_and(&sub_data, to_subtype(right)) & to_subtype(right)); } - __forceinline const type operator ^= (const type& right) volatile + force_inline const type operator ^= (const type& right) volatile { return from_subtype(sync_fetch_and_xor(&sub_data, to_subtype(right)) ^ to_subtype(right)); } diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 1a58360b25..623f1489fb 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -91,7 +91,7 @@ namespace vm bool do_notify; - __noinline void lock() + never_inline void lock() { NamedThreadBase* owner = GetCurrentNamedThread(); NamedThreadBase* old = nullptr; @@ -113,7 +113,7 @@ namespace vm do_notify = true; } - __noinline void unlock() + never_inline void unlock() { NamedThreadBase* owner = GetCurrentNamedThread(); diff --git a/rpcs3/Emu/Memory/vm.h b/rpcs3/Emu/Memory/vm.h index 3447db2b48..162359f9c3 100644 --- a/rpcs3/Emu/Memory/vm.h +++ b/rpcs3/Emu/Memory/vm.h @@ -90,14 +90,14 @@ namespace vm u32 get_addr(const void* real_pointer); - __noinline void error(const u64 addr, const char* func); + never_inline void error(const u64 addr, const char* func); template struct cast_ptr { static_assert(std::is_same::value, "Unsupported vm::cast() type"); - __forceinline static u32 cast(const T& addr, const char* func) + force_inline static u32 cast(const T& addr, const char* func) { return 0; } @@ -106,7 +106,7 @@ namespace vm template<> struct cast_ptr { - __forceinline static u32 cast(const u32 addr, const char* func) + force_inline static u32 cast(const u32 addr, const char* func) { return addr; } @@ -115,7 +115,7 @@ namespace vm template<> struct cast_ptr { - __forceinline static u32 cast(const u64 addr, const char* func) + force_inline static u32 cast(const u64 addr, const char* func) { const u32 res = static_cast(addr); if (res != addr) @@ -130,14 +130,14 @@ namespace vm template struct cast_ptr> { - __forceinline static u32 cast(const be_t& addr, const char* func) + force_inline static u32 cast(const be_t& addr, const char* func) { return cast_ptr::cast(addr.value(), func); } }; template - __forceinline static u32 cast(const T& addr, const char* func = "vm::cast") + force_inline static u32 cast(const T& addr, const char* func = "vm::cast") { return cast_ptr::cast(addr, func); } diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index 4c33d85a6e..2530bd3a3a 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -56,22 +56,22 @@ namespace vm _ptr_base operator - (typename remove_be_t::type count) const { return make(m_addr - count * address_size); } _ptr_base operator - (typename to_be_t::type count) const { return make(m_addr - count * address_size); } - __forceinline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } - __forceinline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } - __forceinline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } - __forceinline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } - __forceinline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } - __forceinline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } - __forceinline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } - __forceinline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } + force_inline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } + force_inline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } + force_inline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } + force_inline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } + force_inline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } + force_inline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } + force_inline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } + force_inline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } explicit operator bool() const { return m_addr != 0; } - __forceinline _ptr_base::value, typename to_be_t::type, AT>>& operator *() const + force_inline _ptr_base::value, typename to_be_t::type, AT>>& operator *() const { return vm::get_ref<_ptr_base::value, typename to_be_t::type, AT>>>(vm::cast(m_addr)); } - __forceinline _ptr_base::value, typename to_be_t::type, AT>>& operator [](AT index) const + force_inline _ptr_base::value, typename to_be_t::type, AT>>& operator [](AT index) const { return vm::get_ref<_ptr_base::value, typename to_be_t::type, AT>>>(vm::cast(m_addr + sizeof(AT)* index)); } @@ -110,12 +110,12 @@ namespace vm static_assert(!std::is_reference::value, "vm::_ptr_base<> error: invalid type (reference)"); typedef typename std::remove_cv::type type; - __forceinline static const u32 data_size() + force_inline static const u32 data_size() { return sizeof(T); } - __forceinline T* const operator -> () const + force_inline T* const operator -> () const { return vm::get_ptr(vm::cast(m_addr)); } @@ -163,29 +163,29 @@ namespace vm _ptr_base operator - (typename remove_be_t::type count) const { return make(m_addr - count * data_size()); } _ptr_base operator - (typename to_be_t::type count) const { return make(m_addr - count * data_size()); } - __forceinline T& operator *() const + force_inline T& operator *() const { return vm::get_ref(vm::cast(m_addr)); } - __forceinline T& operator [](typename remove_be_t::type index) const + force_inline T& operator [](typename remove_be_t::type index) const { return vm::get_ref(vm::cast(m_addr + data_size() * index)); } - __forceinline T& operator [](typename to_be_t::forced_type index) const + force_inline T& operator [](typename to_be_t::forced_type index) const { return vm::get_ref(vm::cast(m_addr + data_size() * index)); } - __forceinline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } - __forceinline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } - __forceinline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } - __forceinline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } - __forceinline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } - __forceinline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } - __forceinline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } - __forceinline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } + force_inline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } + force_inline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } + force_inline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } + force_inline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } + force_inline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } + force_inline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } + force_inline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } + force_inline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } explicit operator bool() const { return m_addr != 0; } explicit operator T*() const { return get_ptr(); } @@ -255,14 +255,14 @@ namespace vm return get_ptr(); } - __forceinline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } - __forceinline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } - __forceinline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } - __forceinline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } - __forceinline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } - __forceinline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } - __forceinline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } - __forceinline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } + force_inline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } + force_inline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } + force_inline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } + force_inline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } + force_inline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } + force_inline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } + force_inline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } + force_inline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } explicit operator bool() const { return m_addr != 0; } template @@ -317,14 +317,14 @@ namespace vm return get_ptr(); } - __forceinline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } - __forceinline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } - __forceinline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } - __forceinline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } - __forceinline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } - __forceinline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } - __forceinline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } - __forceinline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } + force_inline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } + force_inline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } + force_inline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } + force_inline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } + force_inline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } + force_inline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } + force_inline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } + force_inline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } explicit operator bool() const { return m_addr != 0; } template @@ -365,14 +365,14 @@ namespace vm m_addr = value; } - __forceinline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } - __forceinline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } - __forceinline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } - __forceinline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } - __forceinline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } - __forceinline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } - __forceinline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } - __forceinline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } + force_inline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; } + force_inline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; } + force_inline bool operator >(const _ptr_base& right) const { return m_addr > right.m_addr; } + force_inline bool operator >=(const _ptr_base& right) const { return m_addr >= right.m_addr; } + force_inline bool operator ==(const _ptr_base& right) const { return m_addr == right.m_addr; } + force_inline bool operator !=(const _ptr_base& right) const { return m_addr != right.m_addr; } + force_inline bool operator ==(const nullptr_t& right) const { return m_addr == 0; } + force_inline bool operator !=(const nullptr_t& right) const { return m_addr != 0; } explicit operator bool() const { return m_addr != 0; } template @@ -465,7 +465,7 @@ namespace fmt { typedef typename unveil::result_type result_type; - __forceinline static result_type get_value(const vm::_ptr_base& arg) + force_inline static result_type get_value(const vm::_ptr_base& arg) { return unveil::get_value(arg.addr()); } @@ -480,12 +480,12 @@ struct cast_ppu_gpr; template struct cast_ppu_gpr, false> { - __forceinline static u64 to_gpr(const vm::_ptr_base& value) + force_inline static u64 to_gpr(const vm::_ptr_base& value) { return cast_ppu_gpr::value>::to_gpr(value.addr()); } - __forceinline static vm::_ptr_base from_gpr(const u64 reg) + force_inline static vm::_ptr_base from_gpr(const u64 reg) { return vm::_ptr_base::make(cast_ppu_gpr::value>::from_gpr(reg)); } @@ -499,12 +499,12 @@ struct cast_armv7_gpr; template struct cast_armv7_gpr, false> { - __forceinline static u32 to_gpr(const vm::_ptr_base& value) + force_inline static u32 to_gpr(const vm::_ptr_base& value) { return cast_armv7_gpr::value>::to_gpr(value.addr()); } - __forceinline static vm::_ptr_base from_gpr(const u32 reg) + force_inline static vm::_ptr_base from_gpr(const u32 reg) { return vm::_ptr_base::make(cast_armv7_gpr::value>::from_gpr(reg)); } diff --git a/rpcs3/Emu/Memory/vm_ref.h b/rpcs3/Emu/Memory/vm_ref.h index 904d41de03..a2e7903d16 100644 --- a/rpcs3/Emu/Memory/vm_ref.h +++ b/rpcs3/Emu/Memory/vm_ref.h @@ -109,7 +109,7 @@ namespace fmt { typedef typename unveil::result_type result_type; - __forceinline static result_type get_value(const vm::_ref_base& arg) + force_inline static result_type get_value(const vm::_ref_base& arg) { return unveil::get_value(arg.addr()); } @@ -124,12 +124,12 @@ struct cast_ppu_gpr; template struct cast_ppu_gpr, false> { - __forceinline static u64 to_gpr(const vm::_ref_base& value) + force_inline static u64 to_gpr(const vm::_ref_base& value) { return cast_ppu_gpr::value>::to_gpr(value.addr()); } - __forceinline static vm::_ref_base from_gpr(const u64 reg) + force_inline static vm::_ref_base from_gpr(const u64 reg) { return vm::_ref_base::make(cast_ppu_gpr::value>::from_gpr(reg)); } @@ -143,12 +143,12 @@ struct cast_armv7_gpr; template struct cast_armv7_gpr, false> { - __forceinline static u32 to_gpr(const vm::_ref_base& value) + force_inline static u32 to_gpr(const vm::_ref_base& value) { return cast_armv7_gpr::value>::to_gpr(value.addr()); } - __forceinline static vm::_ref_base from_gpr(const u32 reg) + force_inline static vm::_ref_base from_gpr(const u32 reg) { return vm::_ref_base::make(cast_armv7_gpr::value>::from_gpr(reg)); } diff --git a/rpcs3/Emu/Memory/vm_var.h b/rpcs3/Emu/Memory/vm_var.h index b33eaf69cb..dfef1b4a9b 100644 --- a/rpcs3/Emu/Memory/vm_var.h +++ b/rpcs3/Emu/Memory/vm_var.h @@ -425,7 +425,7 @@ namespace vm return m_addr; } - __forceinline uint count() const + force_inline uint count() const { return _count; } diff --git a/rpcs3/Emu/SysCalls/CB_FUNC.h b/rpcs3/Emu/SysCalls/CB_FUNC.h index 92b8c13847..545f2b0d1f 100644 --- a/rpcs3/Emu/SysCalls/CB_FUNC.h +++ b/rpcs3/Emu/SysCalls/CB_FUNC.h @@ -24,7 +24,7 @@ namespace cb_detail { static_assert(sizeof(T) <= 8, "Invalid callback argument type for ARG_GENERAL"); - __forceinline static void set_value(PPUThread& CPU, const T& arg) + force_inline static void set_value(PPUThread& CPU, const T& arg) { CPU.GPR[g_count + 2] = cast_to_ppu_gpr(arg); } @@ -35,7 +35,7 @@ namespace cb_detail { static_assert(sizeof(T) <= 8, "Invalid callback argument type for ARG_FLOAT"); - __forceinline static void set_value(PPUThread& CPU, const T& arg) + force_inline static void set_value(PPUThread& CPU, const T& arg) { CPU.FPR[f_count] = static_cast(arg); } @@ -46,7 +46,7 @@ namespace cb_detail { static_assert(std::is_same::value, "Invalid callback argument type for ARG_VECTOR"); - __forceinline static void set_value(PPUThread& CPU, const T& arg) + force_inline static void set_value(PPUThread& CPU, const T& arg) { CPU.VPR[v_count + 1] = arg; } @@ -59,7 +59,7 @@ namespace cb_detail static_assert(v_count <= 12, "TODO: Unsupported stack argument type (vector)"); static_assert(sizeof(T) <= 8, "Invalid callback argument type for ARG_STACK"); - __forceinline static void set_value(PPUThread& CPU, const T& arg) + force_inline static void set_value(PPUThread& CPU, const T& arg) { const int stack_pos = (g_count - 9) * 8 - FIXED_STACK_FRAME_SIZE; static_assert(stack_pos < 0, "TODO: Increase fixed stack frame size (arg count limit broken)"); @@ -68,14 +68,14 @@ namespace cb_detail }; template - __forceinline static bool _bind_func_args(PPUThread& CPU) + force_inline static bool _bind_func_args(PPUThread& CPU) { // terminator return false; } template - __forceinline static bool _bind_func_args(PPUThread& CPU, T1 arg1, T... args) + force_inline static bool _bind_func_args(PPUThread& CPU, T1 arg1, T... args) { static_assert(!std::is_pointer::value, "Invalid callback argument type (pointer)"); static_assert(!std::is_reference::value, "Invalid callback argument type (reference)"); @@ -99,7 +99,7 @@ namespace cb_detail static_assert(type == ARG_GENERAL, "Wrong use of _func_res template"); static_assert(sizeof(T) <= 8, "Invalid callback result type for ARG_GENERAL"); - __forceinline static T get_value(const PPUThread& CPU) + force_inline static T get_value(const PPUThread& CPU) { return cast_from_ppu_gpr(CPU.GPR[3]); } @@ -110,7 +110,7 @@ namespace cb_detail { static_assert(sizeof(T) <= 8, "Invalid callback result type for ARG_FLOAT"); - __forceinline static T get_value(const PPUThread& CPU) + force_inline static T get_value(const PPUThread& CPU) { return static_cast(CPU.FPR[1]); } @@ -121,7 +121,7 @@ namespace cb_detail { static_assert(std::is_same::value, "Invalid callback result type for ARG_VECTOR"); - __forceinline static T get_value(const PPUThread& CPU) + force_inline static T get_value(const PPUThread& CPU) { return CPU.VPR[2]; } @@ -130,7 +130,7 @@ namespace cb_detail template struct _func_caller { - __forceinline static RT call(PPUThread& CPU, u32 pc, u32 rtoc, T... args) + force_inline static RT call(PPUThread& CPU, u32 pc, u32 rtoc, T... args) { _func_caller::call(CPU, pc, rtoc, args...); @@ -147,7 +147,7 @@ namespace cb_detail template struct _func_caller { - __forceinline static void call(PPUThread& CPU, u32 pc, u32 rtoc, T... args) + force_inline static void call(PPUThread& CPU, u32 pc, u32 rtoc, T... args) { const bool stack = _bind_func_args<0, 0, 0, T...>(CPU, args...); if (stack) CPU.GPR[1] -= FIXED_STACK_FRAME_SIZE; @@ -162,7 +162,7 @@ namespace cb_detail namespace vm { template - __forceinline RT _ptr_base::operator()(PPUThread& CPU, T... args) const + force_inline RT _ptr_base::operator()(PPUThread& CPU, T... args) const { const auto data = vm::get_ptr>(vm::cast(m_addr)); const u32 pc = data[0]; @@ -172,14 +172,14 @@ namespace vm } template - __forceinline RT _ptr_base::operator()(T... args) const + force_inline RT _ptr_base::operator()(T... args) const { return operator()(GetCurrentPPUThread(), args...); } } template -__forceinline RT cb_call(PPUThread& CPU, u32 pc, u32 rtoc, T... args) +force_inline RT cb_call(PPUThread& CPU, u32 pc, u32 rtoc, T... args) { return cb_detail::_func_caller::call(CPU, pc, rtoc, args...); } diff --git a/rpcs3/Emu/SysCalls/LogBase.h b/rpcs3/Emu/SysCalls/LogBase.h index 767594d8ec..621ef6abf0 100644 --- a/rpcs3/Emu/SysCalls/LogBase.h +++ b/rpcs3/Emu/SysCalls/LogBase.h @@ -17,8 +17,7 @@ class LogBase void LogOutput(LogType type, const std::string& text) const; - template - __noinline void LogPrepare(LogType type, const char* fmt, Targs... args) const + template never_inline void LogPrepare(LogType type, const char* fmt, Args... args) const { LogOutput(type, fmt::Format(fmt, args...)); } @@ -36,14 +35,12 @@ public: virtual const std::string& GetName() const = 0; - template - __forceinline void Notice(const char* fmt, Targs... args) const + template force_inline void Notice(const char* fmt, Args... args) printf_alike(2, 3) const { LogPrepare(LogNotice, fmt, fmt::do_unveil(args)...); } - template - __forceinline void Log(const char* fmt, Targs... args) const + template force_inline void Log(const char* fmt, Args... args) printf_alike(2, 3) const { if (CheckLogging()) { @@ -51,32 +48,27 @@ public: } } - template - __forceinline void Success(const char* fmt, Targs... args) const + template force_inline void Success(const char* fmt, Args... args) printf_alike(2, 3) const { LogPrepare(LogSuccess, fmt, fmt::do_unveil(args)...); } - template - __forceinline void Warning(const char* fmt, Targs... args) const + template force_inline void Warning(const char* fmt, Args... args) printf_alike(2, 3) const { LogPrepare(LogWarning, fmt, fmt::do_unveil(args)...); } - template - __forceinline void Error(const char* fmt, Targs... args) const + template force_inline void Error(const char* fmt, Args... args) printf_alike(2, 3) const { LogPrepare(LogError, fmt, fmt::do_unveil(args)...); } - template - __forceinline void Fatal(const char* fmt, Targs... args) const + template force_inline void Fatal(const char* fmt, Args... args) printf_alike(2, 3) const { LogPrepare(LogFatal, fmt, fmt::do_unveil(args)...); } - template - __forceinline void Todo(const char* fmt, Targs... args) const + template force_inline void Todo(const char* fmt, Args... args) printf_alike(2, 3) const { LogPrepare(LogTodo, fmt, fmt::do_unveil(args)...); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp index a2f2cd8860..a585717aff 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp @@ -33,7 +33,7 @@ enum : u32 SAVEDATA_OP_FIXED_DELETE = 14, }; -__noinline s32 savedata_op( +never_inline s32 savedata_op( PPUThread& CPU, u32 operation, u32 version, @@ -61,7 +61,8 @@ __noinline s32 savedata_op( return CELL_SAVEDATA_ERROR_BUSY; } - std::string base_dir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current or specified user + // path of the specified user (00000001 by default) + const std::string base_dir = fmt::format("/dev_hdd0/home/%08d/savedata/", userId ? userId : 1u); vm::stackvar result(CPU); @@ -498,7 +499,7 @@ __noinline s32 savedata_op( fileGet->excSize = 0; memset(fileGet->reserved, 0, sizeof(fileGet->reserved)); - while (true) + while (funcFile) { funcFile(CPU, result, fileGet, fileSet); @@ -785,10 +786,10 @@ s32 cellSaveDataUserListSave( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserListSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserListSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, setList, setBuf, funcList, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_LIST_SAVE, version, vm::null, 0, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserListLoad( @@ -803,10 +804,10 @@ s32 cellSaveDataUserListLoad( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserListLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserListLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, setList, setBuf, funcList, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_LIST_LOAD, version, vm::null, 0, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserFixedSave( @@ -821,10 +822,10 @@ s32 cellSaveDataUserFixedSave( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserFixedSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserFixedSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_FIXED_SAVE, version, vm::null, 0, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserFixedLoad( @@ -839,10 +840,10 @@ s32 cellSaveDataUserFixedLoad( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_FIXED_LOAD, version, vm::null, 0, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserAutoSave( @@ -857,10 +858,10 @@ s32 cellSaveDataUserAutoSave( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, dirName, errDialog, setBuf, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_AUTO_SAVE, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserAutoLoad( @@ -875,10 +876,10 @@ s32 cellSaveDataUserAutoLoad( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, dirName, errDialog, setBuf, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserListAutoSave( @@ -894,10 +895,10 @@ s32 cellSaveDataUserListAutoSave( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_LIST_AUTO_SAVE, version, vm::null, errDialog, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserListAutoLoad( @@ -913,10 +914,10 @@ s32 cellSaveDataUserListAutoLoad( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + cellSysutil.Error("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", version, userId, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); - return CELL_OK; + return savedata_op(CPU, SAVEDATA_OP_LIST_AUTO_LOAD, version, vm::null, errDialog, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); } s32 cellSaveDataUserFixedDelete( @@ -937,7 +938,7 @@ s32 cellSaveDataUserFixedDelete( void cellSaveDataEnableOverlay(s32 enable) { - cellSysutil.Todo("cellSaveDataEnableOverlay(enable=%d)", enable); + cellSysutil.Error("cellSaveDataEnableOverlay(enable=%d)", enable); return; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.h b/rpcs3/Emu/SysCalls/Modules/cellSpurs.h index 8766e47e56..fb84c1f541 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.h @@ -528,7 +528,7 @@ struct CellSpurs } c; }; - __forceinline atomic_be_t& wklState(const u32 wid) + force_inline atomic_be_t& wklState(const u32 wid) { if (wid & 0x10) { @@ -540,12 +540,12 @@ struct CellSpurs } } - __forceinline vm::ptr get_lwmutex() + force_inline vm::ptr get_lwmutex() { return vm::ptr::make(vm::get_addr(&m.mutex)); } - __forceinline vm::ptr get_lwcond() + force_inline vm::ptr get_lwcond() { return vm::ptr::make(vm::get_addr(&m.cond)); } diff --git a/rpcs3/Emu/SysCalls/SC_FUNC.h b/rpcs3/Emu/SysCalls/SC_FUNC.h index a0bf5e87be..898d1f2220 100644 --- a/rpcs3/Emu/SysCalls/SC_FUNC.h +++ b/rpcs3/Emu/SysCalls/SC_FUNC.h @@ -21,7 +21,7 @@ namespace ppu_func_detail { static_assert(sizeof(T) <= 8, "Invalid function argument type for ARG_GENERAL"); - static __forceinline T get_arg(PPUThread& CPU) + static force_inline T get_arg(PPUThread& CPU) { return cast_from_ppu_gpr(CPU.GPR[g_count + 2]); } @@ -32,7 +32,7 @@ namespace ppu_func_detail { static_assert(sizeof(T) <= 8, "Invalid function argument type for ARG_FLOAT"); - static __forceinline T get_arg(PPUThread& CPU) + static force_inline T get_arg(PPUThread& CPU) { return static_cast(CPU.FPR[f_count]); } @@ -43,7 +43,7 @@ namespace ppu_func_detail { static_assert(std::is_same::value, "Invalid function argument type for ARG_VECTOR"); - static __forceinline T get_arg(PPUThread& CPU) + static force_inline T get_arg(PPUThread& CPU) { return CPU.VPR[v_count + 1]; } @@ -56,7 +56,7 @@ namespace ppu_func_detail static_assert(v_count <= 12, "TODO: Unsupported stack argument type (vector)"); static_assert(sizeof(T) <= 8, "Invalid function argument type for ARG_STACK"); - static __forceinline T get_arg(PPUThread& CPU) + static force_inline T get_arg(PPUThread& CPU) { // TODO: check stack argument displacement const u64 res = CPU.GetStackArg(8 + std::max(g_count - 8, 0) + std::max(f_count - 13, 0) + std::max(v_count - 12, 0)); @@ -70,7 +70,7 @@ namespace ppu_func_detail static_assert(type == ARG_GENERAL, "Wrong use of bind_result template"); static_assert(sizeof(T) <= 8, "Invalid function result type for ARG_GENERAL"); - static __forceinline void put_result(PPUThread& CPU, const T& result) + static force_inline void put_result(PPUThread& CPU, const T& result) { CPU.GPR[3] = cast_to_ppu_gpr(result); } @@ -81,7 +81,7 @@ namespace ppu_func_detail { static_assert(sizeof(T) <= 8, "Invalid function result type for ARG_FLOAT"); - static __forceinline void put_result(PPUThread& CPU, const T& result) + static force_inline void put_result(PPUThread& CPU, const T& result) { CPU.FPR[1] = static_cast(result); } @@ -92,7 +92,7 @@ namespace ppu_func_detail { static_assert(std::is_same::value, "Invalid function result type for ARG_VECTOR"); - static __forceinline void put_result(PPUThread& CPU, const T& result) + static force_inline void put_result(PPUThread& CPU, const T& result) { CPU.VPR[2] = result; } @@ -109,7 +109,7 @@ namespace ppu_func_detail template struct bind_arg_packed { - static __forceinline T get_arg(PPUThread& CPU) + static force_inline T get_arg(PPUThread& CPU) { return bind_arg> 8), (type_pack >> 16), (type_pack >> 24)>::get_arg(CPU); } @@ -118,7 +118,7 @@ namespace ppu_func_detail template struct call_impl { - static __forceinline RT call(F f, Tuple && t) + static force_inline RT call(F f, Tuple && t) { return call_impl::call(f, std::forward(t)); } @@ -127,28 +127,28 @@ namespace ppu_func_detail template struct call_impl { - static __forceinline RT call(F f, Tuple && t) + static force_inline RT call(F f, Tuple && t) { return f(std::get(std::forward(t))...); } }; template - __forceinline RT call(F f, Tuple && t) + force_inline RT call(F f, Tuple && t) { typedef typename std::decay::type ttype; return ppu_func_detail::call_impl::value, std::tuple_size::value>::call(f, std::forward(t)); } template - __forceinline std::tuple<> iterate(PPUThread& CPU) + force_inline std::tuple<> iterate(PPUThread& CPU) { // terminator return std::tuple<>(); } template - __forceinline std::tuple iterate(PPUThread& CPU) + force_inline std::tuple iterate(PPUThread& CPU) { static_assert(!std::is_pointer::value, "Invalid function argument type (pointer)"); static_assert(!std::is_reference::value, "Invalid function argument type (reference)"); @@ -223,7 +223,7 @@ namespace ppu_func_detail }; } -template __forceinline void call_ppu_func(PPUThread& CPU, RT(*func)(T...)) +template force_inline void call_ppu_func(PPUThread& CPU, RT(*func)(T...)) { ppu_func_detail::func_binder::do_call(CPU, func); } diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 4fc06a33b3..280907b66f 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -190,10 +190,10 @@ public: void SavePoints(const std::string& path); void LoadPoints(const std::string& path); - __forceinline bool IsRunning() const { return m_status == Running; } - __forceinline bool IsPaused() const { return m_status == Paused; } - __forceinline bool IsStopped() const { return m_status == Stopped; } - __forceinline bool IsReady() const { return m_status == Ready; } + force_inline bool IsRunning() const { return m_status == Running; } + force_inline bool IsPaused() const { return m_status == Paused; } + force_inline bool IsStopped() const { return m_status == Stopped; } + force_inline bool IsReady() const { return m_status == Ready; } }; using lv2_lock_type = std::unique_lock; diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index 7970553e96..0b3601d755 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -52,7 +52,7 @@ typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; -template __forceinline T align(const T addr, int align) +template force_inline T align(const T addr, int align) { return (addr + (align - 1)) & ~(align - 1); }