Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update asm dumps to latest rustc #49

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions asm/datetime_to_systemtime.asm
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,39 @@ datealgo::asm::datetime_to_systemtime:
add rsi, rdi
jns .LBB20_2
test edx, edx
je .LBB20_5
je .LBB20_10
not rsi
mov eax, 1000000000
sub eax, edx
cmp edx, 1000000001
jb .LBB20_9
mov ecx, eax
shr ecx, 9
imul rcx, rcx, 281475
shr rcx, 39
add rsi, rcx
imul ecx, ecx, 1000000000
sub eax, ecx
.LBB20_9:
lea rdi, [rip + .L__unnamed_1]
mov edx, eax
jmp qword ptr [rip + std::time::SystemTime::checked_sub@GOTPCREL]
.LBB20_1:
xor esi, esi
.LBB20_2:
cmp edx, 1000000000
jb .LBB20_4
mov eax, edx
shr eax, 9
imul rax, rax, 281475
shr rax, 39
add rsi, rax
imul eax, eax, 1000000000
sub edx, eax
.LBB20_4:
lea rdi, [rip + .L__unnamed_1]
jmp qword ptr [rip + std::time::SystemTime::checked_add@GOTPCREL]
.LBB20_5:
.LBB20_10:
neg rsi
lea rdi, [rip + .L__unnamed_1]
xor edx, edx
Expand Down
52 changes: 27 additions & 25 deletions asm/isoweekdate_to_date.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,37 @@ datealgo::asm::isoweekdate_to_date:
dec ecx
movzx eax, cl
sub esi, eax
lea ecx, [4*rsi + 1207]
imul rax, rcx, 963315389
shr rax, 47
imul edx, eax, 146097
sub ecx, edx
or ecx, 3
imul rcx, rcx, 2939745
mov edx, ecx
lea eax, [4*rsi + 1207]
imul rcx, rax, 963315389
shr rcx, 47
imul edx, ecx, 146097
sub eax, edx
or eax, 3
imul rax, rax, 2939745
mov edx, eax
imul rdx, rdx, 1531969483
shr rdx, 54
imul edx, edx, 2141
add edx, 197913
movzx esi, dx
shr edx, 16
lea edi, [rdx + 244]
imul r8d, eax, 100
mov rax, rcx
shr rax, 32
add eax, r8d
cmp ecx, -696719416
cmovb edi, edx
sbb eax, -1
add eax, -1468000
imul ecx, esi, 31345
shr ecx, 26
inc ecx
shl rcx, 40
mov esi, edx
shr esi, 16
lea edi, [rsi + 244]
imul r8d, ecx, 100
mov rcx, rax
shr rcx, 32
add ecx, r8d
cmp eax, -696719416
cmovb edi, esi
sbb ecx, -1
movzx eax, dx
add ecx, -1468000
imul eax, eax, 31345
shr eax, 26
shl rax, 40
movzx edx, dil
shl rdx, 32
or rdx, rcx
or rax, rdx
or rdx, rax
or rcx, rdx
movabs rax, 1099511627776
add rax, rcx
ret
30 changes: 15 additions & 15 deletions asm/next_date.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ datealgo::asm::next_date:
mov rsi, rdi
shr rsi, 40
cmp sil, 28
jb .LBB4_3
jae .LBB4_1
.LBB4_3:
add rdi, rcx
movabs rcx, 280375465082880
and rcx, rdi
.LBB4_8:
movzx edx, dl
shl rdx, 32
mov eax, eax
or rax, rcx
or rax, rdx
ret
.LBB4_1:
cmp dl, 2
jne .LBB4_2
imul r8d, edi, -1030792151
Expand All @@ -28,13 +40,7 @@ datealgo::asm::next_date:
xor r8b, dl
or r8b, 30
cmp r8b, sil
jbe .LBB4_4
.LBB4_3:
add rdi, rcx
movabs rcx, 280375465082880
and rcx, rdi
jmp .LBB4_8
.LBB4_4:
ja .LBB4_3
cmp dl, 12
jae .LBB4_5
.LBB4_7:
Expand All @@ -43,10 +49,4 @@ datealgo::asm::next_date:
.LBB4_5:
inc rax
mov edx, 1
.LBB4_8:
movzx edx, dl
shl rdx, 32
mov eax, eax
or rax, rcx
or rax, rdx
ret
jmp .LBB4_8
52 changes: 27 additions & 25 deletions asm/rd_to_date.asm
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
datealgo::asm::rd_to_date:
lea ecx, [4*rdi - 2147385461]
imul rax, rcx, 963315389
shr rax, 47
imul edx, eax, 146097
sub ecx, edx
or ecx, 3
imul rcx, rcx, 2939745
mov edx, ecx
lea eax, [4*rdi - 2147385461]
imul rcx, rax, 963315389
shr rcx, 47
imul edx, ecx, 146097
sub eax, edx
or eax, 3
imul rax, rax, 2939745
mov edx, eax
imul rdx, rdx, 1531969483
shr rdx, 54
imul edx, edx, 2141
add edx, 197913
movzx esi, dx
shr edx, 16
lea edi, [rdx + 244]
imul r8d, eax, 100
mov rax, rcx
shr rax, 32
add eax, r8d
cmp ecx, -696719416
cmovb edi, edx
sbb eax, -1
add eax, -1468000
imul ecx, esi, 31345
shr ecx, 26
inc ecx
shl rcx, 40
mov esi, edx
shr esi, 16
lea edi, [rsi + 244]
imul r8d, ecx, 100
mov rcx, rax
shr rcx, 32
add ecx, r8d
cmp eax, -696719416
cmovb edi, esi
sbb ecx, -1
movzx eax, dx
add ecx, -1468000
imul eax, eax, 31345
shr eax, 26
shl rax, 40
movzx edx, dil
shl rdx, 32
or rdx, rcx
or rax, rdx
or rdx, rax
or rcx, rdx
movabs rax, 1099511627776
add rax, rcx
ret
10 changes: 8 additions & 2 deletions asm/secs_to_systemtime.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,38 @@ datealgo::asm::secs_to_systemtime:
mov rsi, rdi
test rdi, rdi
js .LBB18_1
cmp eax, 1000000000
jb .LBB18_5
mov ecx, eax
shr ecx, 9
imul rcx, rcx, 281475
shr rcx, 39
add rsi, rcx
imul ecx, ecx, 1000000000
sub eax, ecx
.LBB18_5:
lea rdi, [rip + .L__unnamed_1]
mov edx, eax
jmp qword ptr [rip + std::time::SystemTime::checked_add@GOTPCREL]
.LBB18_1:
test eax, eax
je .LBB18_4
je .LBB18_2
not rsi
mov edx, 1000000000
sub edx, eax
cmp eax, 1000000001
jb .LBB18_8
mov eax, edx
shr eax, 9
imul rax, rax, 281475
shr rax, 39
add rsi, rax
imul eax, eax, 1000000000
sub edx, eax
.LBB18_8:
lea rdi, [rip + .L__unnamed_1]
jmp qword ptr [rip + std::time::SystemTime::checked_sub@GOTPCREL]
.LBB18_4:
.LBB18_2:
neg rsi
lea rdi, [rip + .L__unnamed_1]
xor edx, edx
Expand Down
27 changes: 11 additions & 16 deletions asm/systemtime_to_datetime.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
datealgo::asm::systemtime_to_datetime:
push r14
push rbx
sub rsp, 56
sub rsp, 40
mov rbx, rdi
movabs r14, 46387741132800
mov qword ptr [rsp + 24], rsi
Expand All @@ -12,34 +12,29 @@ datealgo::asm::systemtime_to_datetime:
xor ecx, ecx
call qword ptr [rip + std::time::SystemTime::duration_since@GOTPCREL]
cmp qword ptr [rsp], 0
je .LBB19_1
mov rax, qword ptr [rsp + 8]
je .LBB19_1
mov ecx, dword ptr [rsp + 16]
mov qword ptr [rsp + 40], rax
mov dword ptr [rsp + 48], ecx
lea rdi, [rsp + 40]
call qword ptr [rip + std::time::SystemTimeError::duration@GOTPCREL]
cmp edx, 1
cmp ecx, 1
sbb rax, -1
cmp rax, r14
ja .LBB19_6
ja .LBB19_4
mov esi, 1000000000
sub esi, edx
test edx, edx
cmove esi, edx
sub esi, ecx
test ecx, ecx
cmove esi, ecx
neg rax
jmp .LBB19_5
jmp .LBB19_6
.LBB19_1:
mov rax, qword ptr [rsp + 8]
movabs rcx, 46381619174399
cmp rax, rcx
jbe .LBB19_2
.LBB19_6:
.LBB19_4:
xor eax, eax
jmp .LBB19_7
.LBB19_2:
mov esi, dword ptr [rsp + 16]
.LBB19_5:
.LBB19_6:
lea rcx, [r14 + rax]
add rcx, 26438400
movabs rdx, -4454547087429121353
Expand Down Expand Up @@ -98,7 +93,7 @@ datealgo::asm::systemtime_to_datetime:
.LBB19_7:
mov dword ptr [rbx], eax
mov rax, rbx
add rsp, 56
add rsp, 40
pop rbx
pop r14
ret
19 changes: 7 additions & 12 deletions asm/systemtime_to_secs.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
datealgo::asm::systemtime_to_secs:
push rbx
sub rsp, 64
sub rsp, 48
mov rbx, rdi
mov qword ptr [rsp + 32], rsi
mov dword ptr [rsp + 40], edx
Expand All @@ -10,33 +10,28 @@ datealgo::asm::systemtime_to_secs:
xor ecx, ecx
call qword ptr [rip + std::time::SystemTime::duration_since@GOTPCREL]
cmp qword ptr [rsp + 8], 0
je .LBB17_1
mov rax, qword ptr [rsp + 16]
mov ecx, dword ptr [rsp + 24]
mov qword ptr [rsp + 48], rax
mov dword ptr [rsp + 56], ecx
lea rdi, [rsp + 48]
call qword ptr [rip + std::time::SystemTimeError::duration@GOTPCREL]
je .LBB17_1
mov edx, dword ptr [rsp + 24]
cmp edx, 1
sbb rax, -1
movabs rcx, 46387741132800
cmp rax, rcx
ja .LBB17_6
ja .LBB17_5
mov ecx, 1000000000
sub ecx, edx
test edx, edx
cmove ecx, edx
neg rax
jmp .LBB17_3
.LBB17_1:
mov rax, qword ptr [rsp + 16]
movabs rcx, 46381619174399
cmp rax, rcx
jbe .LBB17_2
.LBB17_6:
.LBB17_5:
mov qword ptr [rbx], 0
mov rax, rbx
add rsp, 64
add rsp, 48
pop rbx
ret
.LBB17_2:
Expand All @@ -46,6 +41,6 @@ datealgo::asm::systemtime_to_secs:
mov dword ptr [rbx + 16], ecx
mov qword ptr [rbx], 1
mov rax, rbx
add rsp, 64
add rsp, 48
pop rbx
ret
Loading
Loading