diff options
author | thegeorg <[email protected]> | 2023-08-22 18:56:30 +0300 |
---|---|---|
committer | thegeorg <[email protected]> | 2023-08-22 19:13:38 +0300 |
commit | 769d14120ef8e30363c7dd6870ce1b82552587c3 (patch) | |
tree | c407d1d3f152b9f6eb13f50abc3f5b06db82f9b3 /contrib/libs/asmlib/rdtsc64.asm | |
parent | 494eee7cbbaf3e7d71a133c80c96aec26e518c2a (diff) |
Extract asmlib manipulations into separate block
Diffstat (limited to 'contrib/libs/asmlib/rdtsc64.asm')
-rw-r--r-- | contrib/libs/asmlib/rdtsc64.asm | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/contrib/libs/asmlib/rdtsc64.asm b/contrib/libs/asmlib/rdtsc64.asm deleted file mode 100644 index 42a0e232032..00000000000 --- a/contrib/libs/asmlib/rdtsc64.asm +++ /dev/null @@ -1,53 +0,0 @@ -%include "defs.asm" - -; RDTSC64.ASM
-;
-; Author: Agner Fog
-; Date created: 2003
-; Last modified: 2008-10-16
-; Description:
-;
-; Copyright (c) 2009 GNU General Public License www.gnu.org/licenses
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-default rel
-
-global ReadTSC: function
-
-SECTION .text align=16
-
-; ********** ReadTSC function **********
-; C++ prototype:
-; extern "C" __int64 ReadTSC (void);
-
-; This function returns the value of the time stamp counter, which counts
-; clock cycles. To count how many clock cycles a piece of code takes, call
-; Rdtsc before and after the code to measure and calculate the difference.
-
-; The number of clock cycles taken by the ReadTSC function itself is approximately:
-; Core 2: 730
-; Pentium 4: 700
-; Pentium II and Pentium III: 225
-; AMD Athlon 64, Opteron: 126
-; Does not work on 80386 and 80486.
-
-; Note that clock counts may not be fully reproducible on Intel Core and
-; Core 2 processors because the clock frequency can change. More reliable
-; instruction timings are obtained with the performance monitor counter
-; for "core clock cycles". This requires a kernel mode driver as the one
-; included with www.agner.org/optimize/testp.zip.
-
-ReadTSC:
- push rbx ; ebx is modified by cpuid
- sub eax, eax ; 0
- cpuid ; serialize
- rdtsc ; read time stamp counter into edx:eax
- shl rdx, 32
- or rax, rdx ; combine into 64 bit register
- push rax
- sub eax, eax
- cpuid ; serialize
- pop rax ; return value
- pop rbx
- ret
-;ReadTSC ENDP
|