mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00: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
|
|
@ -1,6 +1,8 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "perf_meter.hpp"
|
||||
|
||||
#include "util/sysinfo.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
|
||||
|
|
@ -65,6 +67,36 @@ void perf_stat_base::print(const char* name) noexcept
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
extern "C" void _mm_lfence();
|
||||
#endif
|
||||
|
||||
SAFE_BUFFERS void perf_stat_base::push(u64 data[66], u64 start_time, const char* name) noexcept
|
||||
{
|
||||
// Event end
|
||||
#ifdef _MSC_VER
|
||||
const u64 end_time = (_mm_lfence(), get_tsc());
|
||||
#else
|
||||
const u64 end_time = (__builtin_ia32_lfence(), get_tsc());
|
||||
#endif
|
||||
|
||||
// Compute difference in seconds
|
||||
const f64 diff = (end_time - start_time) * 1. / utils::get_tsc_freq();
|
||||
|
||||
// Register perf stat in nanoseconds
|
||||
const u64 ns = static_cast<u64>(diff * 1000'000'000.);
|
||||
|
||||
// Print in microseconds
|
||||
if (static_cast<u64>(diff * 1000'000.) >= g_cfg.core.perf_report_threshold)
|
||||
{
|
||||
perf_log.notice(u8"%s: %.3fµs", name, diff * 1000'000.);
|
||||
}
|
||||
|
||||
data[0] += ns != 0;
|
||||
data[64 - std::countl_zero(ns)]++;
|
||||
data[65] += ns;
|
||||
}
|
||||
|
||||
static shared_mutex s_perf_mutex;
|
||||
|
||||
static std::map<std::string, perf_stat_base> s_perf_acc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue