Commit e6942e52 authored by John van Groningen's avatar John van Groningen

add compute_profile_overhead for 64 bit windows

parent 740deda9
_TEXT segment para 'CODE'
_TEXT ends
_DATA segment para 'DATA'
_DATA ends
extern p_time:near
extern g_time_hi:near
extern g_time_lo:near
_TEXT segment
profile_:
push rax
push rdx
rdtsc
sub edx,dword ptr g_time_hi
push rbx
mov ebx,dword ptr g_time_lo
mov eax,eax
shl rdx,32
sub rax,rbx
add rax,rdx
add qword ptr p_time,rax
pop rbx
rdtsc
mov dword ptr g_time_hi,edx
pop rdx
mov dword ptr g_time_lo,eax
pop rax
ret
public compute_profile_overhead
compute_profile_overhead:
mov rax,rcx
push rbx
push rcx
push rdx
push rbp
xor rcx,rcx
xor rdx,rdx
mov rbx,100000
call profile_
mov qword ptr p_time,rcx
compute_profile_overhead_lp1:
lea rbp,p_time
call profile_
add rcx,rcx
add rdx,rdx
sub rbx,1
jne compute_profile_overhead_lp1
mov rcx,qword ptr p_time
mov qword ptr [rax],rcx
xor rcx,rcx
xor rdx,rdx
mov rbx,100000
call profile_
mov qword ptr p_time,rcx
compute_profile_overhead_lp2:
add rcx,rcx
add rdx,rdx
sub rbx,1
jne compute_profile_overhead_lp2
call profile_
mov rcx,qword ptr p_time
mov qword ptr 8[rax],rcx
pop rbp
pop rdx
pop rcx
pop rbx
ret
_TEXT ends
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment