mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 16:02:26 +00:00
rdtsc
This commit is contained in:
parent
0c106e0238
commit
967879682c
@ -40,8 +40,6 @@ static u64 GetTimeNs() {
|
|||||||
|
|
||||||
u64 EstimateRDTSCFrequency()
|
u64 EstimateRDTSCFrequency()
|
||||||
{
|
{
|
||||||
#ifdef __x86_64__
|
|
||||||
|
|
||||||
// Discard the first result measuring the rdtsc.
|
// Discard the first result measuring the rdtsc.
|
||||||
FencedRDTSC();
|
FencedRDTSC();
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds{1});
|
std::this_thread::sleep_for(std::chrono::milliseconds{1});
|
||||||
@ -58,12 +56,6 @@ u64 EstimateRDTSCFrequency()
|
|||||||
const u64 tsc_diff = tsc_end - tsc_start;
|
const u64 tsc_diff = tsc_end - tsc_start;
|
||||||
const u64 tsc_freq = MultiplyAndDivide64(tsc_diff, 1000000000ULL, end_time - start_time);
|
const u64 tsc_freq = MultiplyAndDivide64(tsc_diff, 1000000000ULL, end_time - start_time);
|
||||||
return RoundToNearest<100'000>(tsc_freq);
|
return RoundToNearest<100'000>(tsc_freq);
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "common/types.h"
|
#include "common/types.h"
|
||||||
|
#include "common/logging/log.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
@ -38,7 +39,9 @@ static inline u64 FencedRDTSC() {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
// ARM
|
// ARM
|
||||||
static inline u64 FencedRDTSC() {
|
static inline u64 FencedRDTSC()
|
||||||
|
{
|
||||||
|
LOG_INFO(Core_Linker, "TODO: ARM FencedRDTSC");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user