summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-26 23:33:11 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-26 23:33:11 -0800
commit2bf74b8f25a89c8a49e96e5e44ffd72f495e4930 (patch)
tree1e692f5616d09d99940d985baed6622b23868f15 /lib/std
parent3e8a232eae0fa165d8045f73657d5259e3ad078c (diff)
downloadmc-2bf74b8f25a89c8a49e96e5e44ffd72f495e4930.tar.gz
Actually move %rdx to %rcx before comparing it.
We want to check for the overlap based on the count, not on random junk.
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/memops-impl+posixy-x64.s3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/std/memops-impl+posixy-x64.s b/lib/std/memops-impl+posixy-x64.s
index d43d0f5..c2a3d14 100644
--- a/lib/std/memops-impl+posixy-x64.s
+++ b/lib/std/memops-impl+posixy-x64.s
@@ -7,6 +7,7 @@ std.memfill : (dst : byte#, val : byte, len : std.size -> void)
_std$memblit:
std$memblit:
cmpq %rdi,%rsi
+ movq %rdx,%rcx
jz .done
jg .fwdcpy
movq %rsi,%rax
@@ -14,7 +15,6 @@ std$memblit:
cmpq %rax,%rcx
jg .revcpy
.fwdcpy:
- movq %rdx,%rcx
shrq $3,%rcx
rep movsq
movq %rdx,%rcx
@@ -23,7 +23,6 @@ std$memblit:
jmp .done
.revcpy:
std
- movq %rdx,%rcx
leaq -1(%rdx,%rsi),%rsi
leaq -1(%rdx,%rdi),%rdi
rep movsb