summaryrefslogtreecommitdiff
path: root/rgo/src/memfill.S
diff options
context:
space:
mode:
Diffstat (limited to 'rgo/src/memfill.S')
-rw-r--r--rgo/src/memfill.S14
1 files changed, 6 insertions, 8 deletions
diff --git a/rgo/src/memfill.S b/rgo/src/memfill.S
index c22547e..7dc00c3 100644
--- a/rgo/src/memfill.S
+++ b/rgo/src/memfill.S
@@ -37,16 +37,14 @@ rgo_memfill:
.done:
ret
#elif defined(__x86_64__)
- /* rax: Address of the current element. */
- movq %rdi,%rax
- /* rax: Address of the element after the last element. */
- movq %rdi,%rcx
- addq %rsi,%rcx
+ /* rdi: Address of the current element. */
+ /* rsi: Address of the element after the last element. */
+ addq %rdi,%rsi
.loop:
- cmpq %rcx,%rax
+ cmpq %rsi,%rdi
je .done /* Exit loop if we have reached the final element. */
- movb %dl,(%rax)
- incq %rax
+ movb %dl,(%rdi)
+ incq %rdi
jmp .loop /* Continue to next element. */
.done:
ret