Created
December 30, 2019 06:44
-
-
Save febnug/8caa271998b00fd171e87abfe64417b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int timings[64*N]; | |
int main(void) | |
{ | |
int i; | |
__asm__ __volatile__ ( | |
"lea edx, [timings] \n\t" | |
"rdtsc \n\t" | |
".rept 32 \n\t" | |
"mov eax,[edx] \n\t" | |
"inc eax \n\t" | |
"mov dword ptr [edx], eax \n\t" | |
"add edx, 4 \n\t" | |
".endr \n\t" | |
: | |
: [timings] "m" (*timings) | |
); | |
for(i=0; i<32; i++) | |
printf("%d\n", timings[i]); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment