* src/vm/jit/x86_64/asmpart.S (asm_get_cycle_count): Repaired
authorStefan Ring <stefan@complang.tuwien.ac.at>
Sun, 11 May 2008 18:02:39 +0000 (20:02 +0200)
committerStefan Ring <stefan@complang.tuwien.ac.at>
Sun, 11 May 2008 18:02:39 +0000 (20:02 +0200)
--enable-cycles-stats.

src/vm/jit/x86_64/asmpart.S

index 8e5429847a68e936f9029e53c07d3c543bafce65..4f7a69f9fa074b5c22ccfaed0c05c59ea077b545 100644 (file)
@@ -61,6 +61,8 @@
        .globl asm_compare_and_swap
        .globl asm_memory_barrier
 
+       .globl asm_get_cycle_count
+
 
 /********************* function asm_calljavafunction ***************************
 *                                                                              *
@@ -416,6 +418,20 @@ asm_memory_barrier:
        ret
 
 
+/* asm_get_cycle_count *********************************************************
+
+   Get the current time-stamp counter from the CPU.
+
+*******************************************************************************/
+
+asm_get_cycle_count:
+       rdtsc
+       shl $0x20, %rdx
+       mov %eax, %eax
+       or %rdx, %rax
+       ret
+
+
 /* disable exec-stacks ********************************************************/
 
 #if defined(__linux__) && defined(__ELF__)