pharo-vm icon indicating copy to clipboard operation
pharo-vm copied to clipboard

SmalltalkImage>>#highResClock doesn't work on ARM 64bit

Open pdebruic opened this issue 2 years ago • 1 comments

So AndreasSystemProfiler doesn't work.

Smalltalk highResClock

returns 0.

pdebruic avatar May 03 '22 15:05 pdebruic

Hi

https://github.com/pharo-project/pharo-vm/commit/bc5fda682bbe08bfa33c5c8b6ab2de02621a4131 added support for high res clock on ARM64 linux, however it broke Windows ARM64 build. The issue is due to removed defined(_M_ARM64) in the above mentioned commit, which causes the case switches on ARM64 Windows to fallback to

#elif defined(_WIN32)
   value = __rdtsc();
#else

https://github.com/pharo-project/pharo-vm/blob/809b6e08a721ed5c12e745600d2bf3d0c2e0f517/extracted/vm/src/common/heartbeat.c#L241

__rdtsc is not available on ARM64 architectures: https://learn.microsoft.com/en-us/cpp/intrinsics/rdtsc?view=msvc-170

Learn more about: __rdtsc

syrel avatar Mar 28 '23 10:03 syrel