Linked Questions

23 votes
4 answers
57k views

With Visual Studio I can read the clock cycle count from the processor as shown below. How do I do the same thing with GCC? #ifdef _MSC_VER // Compiler: Microsoft Visual Studio #...
Johan Råde's user avatar
  • 21.7k
5 votes
2 answers
3k views

I have successfully written some inline assembler in gcc to rotate right one bit following some nice instructions: http://www.cs.dartmouth.edu/~sergey/cs108/2009/gcc-inline-asm.pdf Here's an example: ...
Dov's user avatar
  • 8,644
6 votes
1 answer
1k views

I'm new to C++ and benchmarking I don't understand what the this part of the code does? So I found something about the edx, eax registers, but I don't fully understand how that plays into the code. ...
Manjari S's user avatar
3 votes
1 answer
1k views

I am trying to convert someone else's project from 32bit to 64bit. Everything seems to be OK except one function, which uses assembly expressions which are not supported in Visual Studio when building ...
Tomáš Zato's user avatar
2 votes
1 answer
5k views

Possible Duplicate: Getting cpu cycles using RDTSC - why does the value of RDTSC always increase? Get CPU cycle count? I want to write C++ code which analyzes sorting algorithms, and I need to ...
Ben's user avatar
  • 4,328
1 vote
1 answer
4k views

I'm writing code that creates trees and times different methods of creating trees. I can't seem to get rdtsc to function properly, though. Here's my code: #include <stdio.h> #include &...
Greg's user avatar
  • 65
2 votes
2 answers
291 views

I'm trying to figure out how to read this assembly code in C++. This is the code: unsigned __int64 high_perf_time; unsigned __int64 *dest = &high_perf_time; __asm { _emit 0xf // these ...
maor03's user avatar
  • 23
0 votes
1 answer
872 views

I'm trying to generate random numbers but with this seed int rdtsc() { __asm__ __volatile__("rdtsc"); } But when I try to compile I get this error: error C2065: '__asm__' : ...
Deivbid's user avatar
  • 403
1 vote
1 answer
804 views

I have written a very simple C program in an attempt to understand rdtsc in C (Linux).The program is given below. #include <stdio.h> static inline unsigned long long tick() { unsigned ...
liv2hak's user avatar
  • 15k
0 votes
1 answer
692 views

So I'm trying compile some C in GCC for windows. Long story short I can't get Visual Studios to compile an EXE that works on XP. So I thought I'd give GCC a try. The code it's struggling with is: ...
user3078629's user avatar
1 vote
0 answers
500 views

My code is very simple: global start extern printf, Sleep section .data: string db 'End: %llu', 0Ah, 'Start: %llu', 0 section .text: start: mfence lfence rdtsc sub rsp, 8 ...
DarkAtom's user avatar
  • 3,181
0 votes
1 answer
168 views

I am trying to call cpuid before my rdtsc function to prevent out of order. I initially used this rdtsc function to get 2 timestamps and often I get negative numbers, which is undesirable. This is the ...
MitandGrit's user avatar
0 votes
0 answers
210 views

i am not sure how a function that will read the Intelx86 Time stamp counter would look like. i'm trying to measure the performance of a single function so I assume that I would need 2 functions: 1 - ...
Megan Darcy's user avatar
0 votes
0 answers
96 views

I'm a C++ student and I was assigned to measure the time of memory allocation of 1.000.000 integers, using CPUID and RDTSC instructions in inline assembly for G++ compiler. Here is the code I came up ...
Kudor's user avatar
  • 69
1 vote
0 answers
77 views

What is the difference between using thet= __rdtsc() function directly and using asm __volatile__ ( "rdtsc \n" : "=a" (t)); I have seen on ...
Gerrie's user avatar
  • 816

15 30 50 per page
1
2 3 4 5
10