diff options
author | Robin Nehls <nehls@mi.fu-berlin.de> | 2011-05-21 16:43:44 +0200 |
---|---|---|
committer | Robin Nehls <nehls@mi.fu-berlin.de> | 2011-05-21 16:43:44 +0200 |
commit | 7b5013604d4ea4c865aff053b87a54d6cd970700 (patch) | |
tree | 49ec592e6dc322ce0f3a7ef064a318b419580d16 | |
parent | e2a88976dce990b2ee9651a8a68cf1747f306a7c (diff) | |
download | manycore-7b5013604d4ea4c865aff053b87a54d6cd970700.tar.gz manycore-7b5013604d4ea4c865aff053b87a54d6cd970700.tar.bz2 manycore-7b5013604d4ea4c865aff053b87a54d6cd970700.zip |
modified memmeasure funcions to actually do something in memory
this sould show the cache who is the boss. hail to the king baby
-rw-r--r-- | inlineasm.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/inlineasm.h b/inlineasm.h index fc048ca..2779314 100644 --- a/inlineasm.h +++ b/inlineasm.h @@ -9,8 +9,10 @@ static uint32_t optmemmeasure(char* memory, uint32_t offset) "rdtsc ;" "mov %%eax, %%ebp ;" - "cmpb $0x23, (%%ebx) ;" - "cmpb $0x42, (%%ebx, %%ecx) ;" + "movb (%%ebx), %%al ;" + "xor (%%ebx,%%ecx), %%eax ;" + "movb %%al, (%%ebx) ;" + "movb %%al, (%%ebx,%%ecx) ;" "rdtsc ;" "sub %%ebp, %%eax ;" @@ -45,8 +47,10 @@ static uint64_t memmeasure(char* memory, uint64_t offset) // 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) ;" + "movb (%%rbx), %%al ;" + "xor (%%rbx,%%rcx), %%rax ;" + "movb %%al, (%%rbx) ;" + "movb %%al, (%%rbx,%%rcx) ;" "rdtsc ;" "shl $32, %%rdx ;" @@ -69,8 +73,10 @@ static uint64_t optmemmeasure(char* memory, uint64_t offset) // 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) ;" + "movb (%%rbx), %%al ;" + "xor (%%rbx,%%rcx), %%rax ;" + "movb %%al, (%%rbx) ;" + "movb %%al, (%%rbx,%%rcx) ;" "rdtsc ;" "sub %%edi, %%eax ;" |