MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / CycleCounter

Method CycleCounter

FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp:3081–3097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3079}
3080
3081OpDispatchBuilder::CycleCounterPair OpDispatchBuilder::CycleCounter(bool SelfSynchronizingLoads) {
3082 Ref CounterLow {};
3083 Ref CounterHigh {};
3084 auto Counter = _CycleCounter(SelfSynchronizingLoads);
3085 if (CTX->Config.TSCScale) {
3086 CounterLow = _Lshl(OpSize::i32Bit, Counter, Constant(CTX->Config.TSCScale));
3087 CounterHigh = _Lshr(OpSize::i64Bit, Counter, Constant(32 - CTX->Config.TSCScale));
3088 } else {
3089 CounterLow = _Bfe(OpSize::i64Bit, 32, 0, Counter);
3090 CounterHigh = _Bfe(OpSize::i64Bit, 32, 32, Counter);
3091 }
3092
3093 return {
3094 .CounterLow = CounterLow,
3095 .CounterHigh = CounterHigh,
3096 };
3097}
3098
3099void OpDispatchBuilder::RDTSCOp(OpcodeArgs) {
3100 auto Counter = CycleCounter(false);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected