Commit 03a18c27 authored by Martin Pales's avatar Martin Pales Committed by Martin Sustrik

zmq::clock_t : return correct value in rdtsc() on solaris

Function clock_t::rdtsc() now returns correct value when compiled
with sunstudio 12 compiler.
Signed-off-by: 's avatarMartin Pales <m.pales@gmail.com>
parent b7386f5b
...@@ -94,6 +94,14 @@ uint64_t zmq::clock_t::rdtsc () ...@@ -94,6 +94,14 @@ uint64_t zmq::clock_t::rdtsc ()
uint32_t low, high; uint32_t low, high;
__asm__ volatile ("rdtsc" : "=a" (low), "=d" (high)); __asm__ volatile ("rdtsc" : "=a" (low), "=d" (high));
return (uint64_t) high << 32 | low; return (uint64_t) high << 32 | low;
#elif (defined __SUNPRO_CC && (__SUNPRO_CC >= 0x5100) && (defined __i386 || \
defined __amd64 || defined __x86_64))
union {
uint64_t u64val;
uint32_t u32val [2];
} tsc;
asm("rdtsc" : "=a" (tsc.u32val [0]), "=d" (tsc.u32val [1]));
return tsc.u64val;
#else #else
return 0; return 0;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment