mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 07:21:25 +12:00
types.hpp: remove intrinsic includes
Replace v128 with u128 in some places. Removed some unused files.
This commit is contained in:
parent
5f618814f6
commit
bd269bccaf
64 changed files with 899 additions and 2265 deletions
|
@ -17,6 +17,13 @@
|
|||
|
||||
#include "util/asm.hpp"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
extern "C"
|
||||
{
|
||||
u64 _xgetbv(u32);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline std::array<u32, 4> utils::get_cpuid(u32 func, u32 subfunc)
|
||||
{
|
||||
int regs[4];
|
||||
|
@ -303,6 +310,19 @@ static constexpr ullong round_tsc(ullong val)
|
|||
return utils::rounded_div(val, 1'000'000) * 1'000'000;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
extern "C" void _mm_lfence();
|
||||
#endif
|
||||
|
||||
static inline void lfence()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_mm_lfence();
|
||||
#else
|
||||
__builtin_ia32_lfence();
|
||||
#endif
|
||||
}
|
||||
|
||||
ullong utils::get_tsc_freq()
|
||||
{
|
||||
static const ullong cal_tsc = []() -> ullong
|
||||
|
@ -343,17 +363,17 @@ ullong utils::get_tsc_freq()
|
|||
{
|
||||
#ifdef _WIN32
|
||||
Sleep(1);
|
||||
error_data[i] = (_mm_lfence(), __rdtsc());
|
||||
error_data[i] = (lfence(), utils::get_tsc());
|
||||
LARGE_INTEGER ctr;
|
||||
QueryPerformanceCounter(&ctr);
|
||||
rdtsc_data[i] = (_mm_lfence(), __rdtsc());
|
||||
rdtsc_data[i] = (lfence(), utils::get_tsc());
|
||||
timer_data[i] = ctr.QuadPart;
|
||||
#else
|
||||
usleep(200);
|
||||
error_data[i] = (_mm_lfence(), __rdtsc());
|
||||
error_data[i] = (lfence(), utils::get_tsc());
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
rdtsc_data[i] = (_mm_lfence(), __rdtsc());
|
||||
rdtsc_data[i] = (lfence(), utils::get_tsc());
|
||||
timer_data[i] = ts.tv_nsec + (ts.tv_sec - sec_base) * 1'000'000'000;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue