-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,418 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
datealgo::asm::date_to_isoweekdate: | ||
|
||
movabs rax, 281474976710655 | ||
|
||
and rax, rdi | ||
|
||
mov rcx, rax | ||
shr rcx, 32 | ||
|
||
cmp cl, 3 | ||
|
||
sbb edi, 0 | ||
|
||
movzx edx, cl | ||
lea esi, [rdx + 12] | ||
|
||
cmp cl, 3 | ||
|
||
cmovae esi, edx | ||
|
||
shr rax, 40 | ||
|
||
add edi, 1468000 | ||
|
||
imul rcx, rdi, 1374389535 | ||
|
||
mov rdx, rcx | ||
shr rdx, 37 | ||
|
||
imul edi, edi, 1461 | ||
|
||
shr edi, 2 | ||
shr rcx, 39 | ||
|
||
imul esi, esi, 979 | ||
|
||
add esi, -2919 | ||
shr esi, 5 | ||
|
||
sub eax, edx | ||
|
||
add ecx, edi | ||
|
||
add ecx, eax | ||
|
||
lea eax, [rcx + rsi] | ||
|
||
add ecx, esi | ||
add ecx, -307 | ||
|
||
movsxd rcx, ecx | ||
|
||
movabs rdx, 2635249153387078802 | ||
|
||
imul rcx, rdx | ||
|
||
add rcx, rdx | ||
|
||
shr rcx, 61 | ||
|
||
sub eax, ecx | ||
lea edx, [rax - 536895455] | ||
|
||
lea edx, [4*rdx - 2147385461] | ||
|
||
imul rsi, rdx, 963315389 | ||
|
||
shr rsi, 47 | ||
imul edi, esi, 146097 | ||
sub edx, edi | ||
|
||
or edx, 3 | ||
|
||
imul rdx, rdx, 2939745 | ||
|
||
imul esi, esi, 100 | ||
|
||
mov rdi, rdx | ||
shr rdi, 32 | ||
|
||
add edi, esi | ||
|
||
cmp edx, -696719416 | ||
|
||
sbb edi, -1 | ||
|
||
lea edx, [rdi - 1468000] | ||
|
||
dec edi | ||
|
||
imul rsi, rdi, 1374389535 | ||
|
||
mov r8, rsi | ||
shr r8, 37 | ||
|
||
imul edi, edi, 1461 | ||
|
||
shr edi, 2 | ||
shr rsi, 39 | ||
|
||
add eax, r8d | ||
add eax, -536895455 | ||
add esi, edi | ||
sub eax, esi | ||
mov esi, eax | ||
add esi, 536895152 | ||
movsxd rsi, esi | ||
imul rsi, rsi, -1840700269 | ||
shr rsi, 32 | ||
add eax, esi | ||
add eax, 536895152 | ||
mov esi, eax | ||
shr esi, 2 | ||
shr eax, 31 | ||
|
||
shl rcx, 40 | ||
|
||
add eax, esi | ||
inc eax | ||
movzx eax, al | ||
shl rax, 32 | ||
or rax, rcx | ||
or rax, rdx | ||
|
||
ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
datealgo::asm::date_to_rd: | ||
|
||
movabs rax, 281474976710655 | ||
|
||
and rax, rdi | ||
|
||
mov rcx, rax | ||
shr rcx, 32 | ||
|
||
cmp cl, 3 | ||
|
||
sbb edi, 0 | ||
|
||
movzx edx, cl | ||
lea esi, [rdx + 12] | ||
|
||
cmp cl, 3 | ||
|
||
cmovae esi, edx | ||
|
||
shr rax, 40 | ||
|
||
add edi, 1468000 | ||
|
||
imul rcx, rdi, 1374389535 | ||
|
||
mov rdx, rcx | ||
shr rdx, 37 | ||
|
||
imul edi, edi, 1461 | ||
|
||
shr edi, 2 | ||
shr rcx, 39 | ||
|
||
imul esi, esi, 979 | ||
|
||
add esi, -2919 | ||
shr esi, 5 | ||
|
||
sub eax, edx | ||
|
||
add ecx, edi | ||
|
||
add ecx, eax | ||
|
||
lea eax, [rsi + rcx] | ||
add eax, -536895459 | ||
|
||
ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
datealgo::asm::date_to_weekday: | ||
|
||
movabs rax, 281474976710655 | ||
|
||
and rax, rdi | ||
|
||
mov rcx, rax | ||
shr rcx, 32 | ||
|
||
cmp cl, 3 | ||
|
||
sbb edi, 0 | ||
|
||
movzx edx, cl | ||
lea esi, [rdx + 12] | ||
|
||
cmp cl, 3 | ||
|
||
cmovae esi, edx | ||
|
||
shr rax, 40 | ||
|
||
add edi, 1468000 | ||
|
||
imul rcx, rdi, 1374389535 | ||
|
||
mov rdx, rcx | ||
shr rdx, 37 | ||
|
||
imul edi, edi, 1461 | ||
|
||
shr edi, 2 | ||
shr rcx, 39 | ||
|
||
imul esi, esi, 979 | ||
|
||
add esi, -2919 | ||
shr esi, 5 | ||
|
||
sub eax, edx | ||
|
||
add ecx, edi | ||
|
||
add ecx, eax | ||
|
||
lea eax, [rsi + rcx] | ||
add eax, -306 | ||
movsxd rcx, eax | ||
|
||
movabs rax, 2635249153387078802 | ||
|
||
imul rax, rcx | ||
|
||
shr rax, 61 | ||
|
||
ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
datealgo::asm::datetime_to_secs: | ||
|
||
mov ecx, dword ptr [rdi] | ||
|
||
movzx eax, byte ptr [rdi + 4] | ||
cmp eax, 3 | ||
|
||
sbb ecx, 0 | ||
|
||
lea edx, [rax + 12] | ||
|
||
cmp eax, 3 | ||
|
||
cmovae edx, eax | ||
|
||
movzx esi, byte ptr [rdi + 5] | ||
|
||
add ecx, 1468000 | ||
|
||
imul rax, rcx, 1374389535 | ||
|
||
mov r8, rax | ||
shr r8, 37 | ||
|
||
imul r9d, ecx, 1461 | ||
shr r9d, 2 | ||
shr rax, 39 | ||
|
||
imul ecx, edx, 979 | ||
|
||
add ecx, -2919 | ||
shr ecx, 5 | ||
|
||
sub esi, r8d | ||
add eax, r9d | ||
|
||
add eax, esi | ||
|
||
lea edx, [rcx + rax] | ||
|
||
add edx, -307 | ||
cmp edx, 1073719447 | ||
ja .LBB9_1 | ||
|
||
add eax, ecx | ||
add eax, -536895459 | ||
|
||
movzx ecx, byte ptr [rdi + 8] | ||
|
||
movzx edx, byte ptr [rdi + 7] | ||
|
||
movzx esi, byte ptr [rdi + 6] | ||
|
||
cdqe | ||
|
||
imul rdi, rax, 86400 | ||
|
||
imul rsi, rsi, 3600 | ||
imul rax, rdx, 60 | ||
add rax, rcx | ||
add rax, rsi | ||
add rax, rdi | ||
|
||
ret | ||
|
||
.LBB9_1: | ||
xor eax, eax | ||
ret | ||
|
Oops, something went wrong.