Skip to content

Commit

Permalink
Remove unnecessary assignment to register
Browse files Browse the repository at this point in the history
  • Loading branch information
dpino committed Feb 11, 2018
1 parent 8dad2d6 commit 6f12e3b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/lib/newchecksum.dasl
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ local function gen_checksum ()
| 1:
| cmp rcx, 32 -- If index is less than 16.
| jl >2 -- Jump to branch '2'.
| mov r9, [rdi + r8] -- Fetch 64-bit from data + r8 into r9.
| add rax, r9 -- Sum acc with qword[0].
| add rax, [rdi + r8] -- Sum acc with qword[0].
| adc rax, [rdi + r8 + 8] -- Sum with carry qword[1].
| adc rax, [rdi + r8 + 16] -- Sum with carry qword[2].
| adc rax, [rdi + r8 + 24] -- Sum with carry qword[3]
Expand All @@ -54,17 +53,15 @@ local function gen_checksum ()
| 2:
| cmp rcx, 16 -- If index is less than 16.
| jl >3 -- Jump to branch '2'.
| mov r9, [rdi + r8] -- Fetch 64-bit from data + r8 into r9.
| add rax, r9 -- Sum acc with r9.
| adc rax, [rdi + r8 + 8] -- Sum with carry next qword.
| add rax, [rdi + r8] -- Sum acc with qword[0].
| adc rax, [rdi + r8 + 8] -- Sum with carry qword[1].
| adc rax, 0 -- Sum carry-bit into acc.
| sub rcx, 16 -- Decrease index by 8.
| add r8, 16 -- Jump two qwords.
| 3:
| cmp rcx, 8 -- If index is less than 8.
| jl >4 -- Jump to branch '2'.
| mov r9, [rdi + r8] -- Fetch 64-bit from data + r8 into r9.
| add rax, r9 -- Sum acc with r9.
| add rax, [rdi + r8] -- Sum acc with qword[0].
| adc rax, 0 -- Sum carry-bit into acc.
| sub rcx, 8 -- Decrease index by 8.
| add r8, 8 -- Next 64-bit.
Expand Down

0 comments on commit 6f12e3b

Please sign in to comment.