summaryrefslogtreecommitdiffstats
path: root/inlineasm.h
diff options
context:
space:
mode:
authoryves <steve.harrison@gmx.net>2011-05-24 14:20:13 +0200
committeryves <steve.harrison@gmx.net>2011-05-24 14:20:13 +0200
commitef176e8f2d80fbdebb3b6e00005dd873fc2c4233 (patch)
tree43c169ec48efb0ca3ebc0818c67e0e8080bb2d79 /inlineasm.h
parentc630a1b07403339ab3ce74cc10798cd0353230ad (diff)
downloadmanycore-ef176e8f2d80fbdebb3b6e00005dd873fc2c4233.tar.gz
manycore-ef176e8f2d80fbdebb3b6e00005dd873fc2c4233.tar.bz2
manycore-ef176e8f2d80fbdebb3b6e00005dd873fc2c4233.zip
put yves asm in
Diffstat (limited to 'inlineasm.h')
-rw-r--r--inlineasm.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/inlineasm.h b/inlineasm.h
index fc048ca..218c532 100644
--- a/inlineasm.h
+++ b/inlineasm.h
@@ -38,14 +38,17 @@ static uint64_t rdtsc()
static uint64_t memmeasure(char* memory, uint64_t offset)
{
asm(
+
+ // here be magic dragons and memory access (read segfaults) ahead
+ // TODO: evaluate if more cmp types (like w and l) do make sense
+ "cmpb $0x23, (%%rbx) ;"
+
+ // get starting time
"rdtsc ;"
"shl $32, %%rdx ;"
"add %%rax, %%rdx ;"
"mov %%rdx, %%rdi ;"
- // here be magic dragons and memory access (read segfaults) ahead
- // TODO: evaluate if more cmp types (like w and l) do make sense
- "cmpb $0x23, (%%rbx) ;"
"cmpb $0x42, (%%rbx,%%rcx) ;"
"rdtsc ;"