AbstractOperatingSystem.st
changeset 20871 2e066b1ae899
parent 20781 bb433fa13791
child 20927 99f7f2a6debe
--- a/AbstractOperatingSystem.st	Mon Nov 07 11:49:17 2016 +0100
+++ b/AbstractOperatingSystem.st	Mon Nov 07 11:49:56 2016 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -6642,19 +6644,17 @@
      Notice, that the # of cycles has to be multiplied by the cycle time (1/cpu-frequency).
 
      For x86:
-	the CPU cycle count register value is returned (RDTSC instruction).
-	Fails if RDTSC instruction is not supported (which is unlikely, nowadays).
+        the CPU cycle count register value is returned (RDTSC instruction).
+        answer 0 if RDTSC instruction is not supported (which is unlikely, nowadays).
      For others:
-	currently fails"
+        answer 0"
 
 %{  /* NOCONTEXT */
     unsigned INT low, high;
 
-#ifdef __x86_64__
-# if defined(__GCC__) || defined(__CLANG__) || defined(__MINGW64__)
+#if defined(__x86_64__) && (defined(__GNUC__) || defined(__CLANG__) || defined(__MINGW64__))
     asm volatile("rdtsc" : "=a"(low), "=d"(high));
     RETURN ( __MKUINT(low + (high << 32)) );
-# endif
 #endif
 
 #ifdef i386
@@ -6666,19 +6666,17 @@
     _asm { mov low,eax };
     _asm { mov high,edx };
     _asm { pop edx };
-# else
-#  if defined(__MINGW_H) || defined(__MINGW32__) || defined(__GNUC__)
+# elif defined(__MINGW_H) || defined(__MINGW32__) || defined(__GNUC__)
     asm volatile("rdtsc" : "=a"(low), "=d"(high));
-#  else
+# else
     goto unsupported;
-#  endif
 # endif
     RETURN ( __MKLARGEINT64(1, low, high) );
 #endif /* i386 */
 
 unsupported: ;
 %}.
-    self primitiveFailed:'no CPU cycle register on this architecture'
+    ^ 0
 
     "
      OperatingSystem getCPUCycleCount