Optimise DateTime.ObjectEquals
53 lines
## .NET 7.0.0 (7.0.22.47809), X64 RyuJIT AVX2
## .NET 8.0.0 (42.42.42.42424), X64 RyuJIT AVX2
; System.DateTime.Equals(System.Object)
; System.DateTime.Equals(System.Object)
push rdi
push rdi
push rsi
push rsi
push rbx
sub rsp,28
sub rsp,20
mov rdi,rcx
mov rdi,rcx
mov rsi,rdx
mov rsi,rdx
mov rcx,rsi
mov rcx,rsi
call qword ptr [System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
call qword ptr [System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
test rax,rax
test rax,rax
je short M01_L01
je short M01_L01
mov rbx,3FFFFFFFFFFFFFFF
and rbx,[rdi]
mov rcx,[rsi]
mov rcx,[rsi]
cmp rcx,[System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
cmp rcx,[System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
je short M01_L00
je short M01_L00
mov rcx,[System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
mov rcx,[System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
mov rdx,rsi
mov rdx,rsi
call qword ptr [System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
call qword ptr [System.Reflection.CustomAttributeExtensions.GetCustomAttribute[[System.__Canon, System.Private.CoreLib]](System.Reflection.Assembly)]
M01_L00:
M01_L00:
mov rax,[rsi+8]
mov rax,[rsi+8]
mov rdx,3FFFFFFFFFFFFFFF
mov rdx,[rdi]
and rax,rdx
xor rax,rdx
cmp rbx,rax
shl rax,2
sete al
sete al
movzx eax,al
movzx eax,al
add rsp,20
add rsp,28
pop rbx
pop rsi
pop rsi
pop rdi
pop rdi
ret
ret
M01_L01:
M01_L01:
xor eax,eax
xor eax,eax
add rsp,20
add rsp,28
pop rbx
pop rsi
pop rsi
pop rdi
pop rdi
ret
ret
Text moved from lines 48-52
int 3
int 3
int 3
int 3
int 3
int 3
mov rax,[rcx]
mov rax,[rcx]
xor rax,rdx
xor rax,rdx
shl rax,2
shl rax,2
sete al
sete al
movzx eax,al
movzx eax,al
ret
ret
int 3
int 3
int 3
int 3
Text moved to lines 35-39
int 3
; Total bytes of code 115
int 3
int 3
int 3
int 3
; Total bytes of code 136