Skip to content

Commit

Permalink
- swapped the __x86_64__ and __i386__ cases in measure time - hopeful…
Browse files Browse the repository at this point in the history
…ly this will fix measureTime on x64 machines

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23789 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Dec 15, 2014
1 parent 8479333 commit afb7e55
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions SimulationRuntime/cpp/Core/Utils/extension/measure_time_rdtsc.cpp
Expand Up @@ -86,22 +86,20 @@ unsigned long long MeasureTimeRDTSC::RDTSC()
}
#endif // defined(__i386__) || defined(__x86_64__)
#else
#if defined(__i386__)
unsigned long long MeasureTimeRDTSC::RDTSC()
{
unsigned long long res;
asm volatile (".byte 0x0f, 0x31" : "=A" (res));
return res;
}

#elif defined(__x86_64__)
#if defined(__x86_64__)
unsigned long long MeasureTimeRDTSC::RDTSC()
{
unsigned hi, lo;
__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
return ((unsigned long long) lo) | (((unsigned long long) hi) << 32);
}

#elif defined(__i386__)
unsigned long long MeasureTimeRDTSC::RDTSC()
{
unsigned long long res;
asm volatile (".byte 0x0f, 0x31" : "=A" (res));
return res;
}
#else
unsigned long long MeasureTimeRDTSC::RDTSC()
{
Expand Down

0 comments on commit afb7e55

Please sign in to comment.