summaryrefslogtreecommitdiff
path: root/zap/source/amd64/mem/cp.s
diff options
context:
space:
mode:
Diffstat (limited to 'zap/source/amd64/mem/cp.s')
-rw-r--r--zap/source/amd64/mem/cp.s15
1 files changed, 8 insertions, 7 deletions
diff --git a/zap/source/amd64/mem/cp.s b/zap/source/amd64/mem/cp.s
index 3c9f2e1..b0b91e5 100644
--- a/zap/source/amd64/mem/cp.s
+++ b/zap/source/amd64/mem/cp.s
@@ -14,38 +14,38 @@ zap_cp:
.big02cp: # big02cp:; // We assume AVX.
cmp rdx,0x20
- jl short .big01cp # if (num < 0x20u) goto big01cp;
+ jl short .big01cp # if (rem < 0x20u) goto big01cp;
vmovdqu ymm0,[rsi] # val02 = *(unsigned int256_t *)src;
vmovdqu [rdi],ymm0 # *(unsigned int256_t *)dest = val02;
add rdi,0x20 # dest += 0x20u;
add rsi,0x20 # src += 0x20u;
- sub rdx,0x20 # num -= 0x20u;
+ sub rdx,0x20 # rem -= 0x20u;
jmp short .big02cp # goto big02cp;
.big01cp: # big01cp:;
cmp rdx,0x10
- jl short .wrdcp # if (num < 0x10u) goto wrdcp;
+ jl short .wrdcp # if (rem < 0x10u) goto wrdcp;
movdqu xmm0,[rsi] # val01 = *(unsigned int128_t *)src;
movdqu [rdi],xmm0 # *(unsigned int128_t *)dest = val01;
add rdi,0x10 # dest += 0x10u;
add rsi,0x10 # src += 0x10u;
- sub rdx,0x10 # num -= 0x10u;
+ sub rdx,0x10 # rem -= 0x10u;
jmp short .big01cp # goto big01cp;
.wrdcp: # wrdcp:;
cmp rdx,0x8
- jl short .bytecp # if (num < 0x8u) goto bytecp;
+ jl short .bytecp # if (rem < 0x8u) goto bytecp;
mov rcx,[rsi] # val8 = *(zap_i04 *)src;
mov [rdi],rcx # *(zap_i04 *)dest = val8;
add rsi,0x8 # dest += 0x8u;
add rdi,0x8 # src += 0x8u;
- sub rdx,0x8 # num -= 0x8u;
+ sub rdx,0x8 # rem -= 0x8u;
jmp short .wrdcp # goto wrdcp
.bytecp: # bytecp:;
@@ -62,4 +62,5 @@ zap_cp:
.done:
mov rax,rdi
- ret # return dest;
+ mov rdx,rsi
+ ret # return (zap_cpret) {.dest = dest,.src = src};