summaryrefslogtreecommitdiffstats
path: root/inlineasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'inlineasm.h')
-rw-r--r--inlineasm.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/inlineasm.h b/inlineasm.h
index af466d3..fc048ca 100644
--- a/inlineasm.h
+++ b/inlineasm.h
@@ -26,7 +26,7 @@ static uint64_t rdtsc()
"rdtsc ;"
: "=A" (rdtsc)
);
-
+
return rdtsc;
}
@@ -42,12 +42,12 @@ static uint64_t memmeasure(char* memory, uint64_t offset)
"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
+ // TODO: evaluate if more cmp types (like w and l) do make sense
"cmpb $0x23, (%%rbx) ;"
"cmpb $0x42, (%%rbx,%%rcx) ;"
-
+
"rdtsc ;"
"shl $32, %%rdx ;"
"add %%rdx, %%rax ;"
@@ -55,7 +55,7 @@ static uint64_t memmeasure(char* memory, uint64_t offset)
: : "b" (memory), "c" (offset)
);
}
-
+
// this implementation only uses the lower part of the values retured by
// rdtsc to save instrucions. it is not significantly faster than the
// accurate one but it has fewer instrucions and by that is less likely
@@ -66,12 +66,12 @@ static uint64_t optmemmeasure(char* memory, uint64_t offset)
asm(
"rdtsc ;"
"mov %%eax, %%edi ;"
-
+
// here be magic dragons and memory access (read segfaults) ahead
- // TODO: evaluate if more cmp types (like w and l) do make sense
+ // TODO: evaluate if more cmp types (like w and l) do make sense
"cmpb $0x23, (%%rbx) ;"
"cmpb $0x42, (%%rbx,%%rcx) ;"
-
+
"rdtsc ;"
"sub %%edi, %%eax ;"
: : "b" (memory), "c" (offset)